diff --git a/model-api/cmmn-model/.clirr-jenkins-ignore.xml b/model-api/cmmn-model/.clirr-jenkins-ignore.xml new file mode 100644 index 00000000000..a56634296b0 --- /dev/null +++ b/model-api/cmmn-model/.clirr-jenkins-ignore.xml @@ -0,0 +1,14 @@ + + + + ** + 5000 + ** + + + + ** + 7012 + * + + diff --git a/model-api/cmmn-model/LICENSE b/model-api/cmmn-model/LICENSE new file mode 100644 index 00000000000..d0381d6d04c --- /dev/null +++ b/model-api/cmmn-model/LICENSE @@ -0,0 +1,176 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/model-api/cmmn-model/NOTICE b/model-api/cmmn-model/NOTICE new file mode 100644 index 00000000000..d9f6ed1e7b4 --- /dev/null +++ b/model-api/cmmn-model/NOTICE @@ -0,0 +1,2 @@ +Camunda +Copyright 2014-2019 Camunda Services GmbH diff --git a/model-api/cmmn-model/README.md b/model-api/cmmn-model/README.md new file mode 100644 index 00000000000..b50ef16f6d6 --- /dev/null +++ b/model-api/cmmn-model/README.md @@ -0,0 +1,7 @@ +camunda-cmmn-model +================== + +CMMN model API written in Java. + +## License +The source files in this repository are made available under the [Apache License Version 2.0](./LICENSE). diff --git a/model-api/cmmn-model/pom.xml b/model-api/cmmn-model/pom.xml new file mode 100644 index 00000000000..d11be1f16af --- /dev/null +++ b/model-api/cmmn-model/pom.xml @@ -0,0 +1,206 @@ + + 4.0.0 + + + org.camunda + camunda-bpm-release-parent + 1.0.0 + + + + + org.camunda.bpm.model + camunda-cmmn-model + 7.13.0-SNAPSHOT + camunda BPM - CMMN Model API + jar + + + 7.12.0 + false + + + + + + + org.camunda.bpm.model + camunda-xml-model + ${project.version} + + + + junit + junit + 4.12 + + + + org.assertj + assertj-core + 2.9.1 + + + + + + + + + org.camunda.bpm.model + camunda-xml-model + + + + junit + junit + test + + + + org.assertj + assertj-core + test + + + + + + + + + org.apache.felix + maven-bundle-plugin + + + org.camunda.bpm.model* + + + + + bundle-manifest + process-classes + + manifest + + + + + + org.codehaus.mojo + license-maven-plugin + 1.14 + + test + + + + + + + + + license-header-check + + + + com.mycila + license-maven-plugin + + + + + + check-api-compatibility + + true + + + + + org.codehaus.mojo + clirr-maven-plugin + 2.8 + + ${camunda.version.old} + true + + org/camunda/bpm/model/cmmn/impl/** + + + + + all + verify + + check-no-fork + + + ${project.build.directory}/clirr-all.txt + false + false + + + + restrictive + verify + + check-no-fork + + + ${project.build.directory}/clirr-restrictive.txt + true + .clirr-jenkins-ignore.xml + + + + + + + + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + + + + + camunda services GmbH + http://www.camunda.com + + + http://www.camunda.org + + 2014 + + + + camunda.org + camunda BPM Community + camunda.org + http://camunda.org + + + + + https://github.com/camunda/camunda-cmmn-model + scm:git:git@github.com:camunda/camunda-cmmn-model.git + scm:git:git@github.com:camunda/camunda-cmmn-model.git + HEAD + + + + Jira + https://app.camunda.com/jira/browse/CAM/ + + + + + fix-maven-snapshots-issue-with-nexus + allow-resolving-snapshots + + + diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/AssociationDirection.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/AssociationDirection.java new file mode 100644 index 00000000000..26f300f39e8 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/AssociationDirection.java @@ -0,0 +1,29 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn; + +/** + * @author Roman Smirnov + * + */ +public enum AssociationDirection { + + None, + One, + Both + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/CaseFileItemTransition.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/CaseFileItemTransition.java new file mode 100644 index 00000000000..4f081d31209 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/CaseFileItemTransition.java @@ -0,0 +1,41 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn; + +/** + * @author Roman Smirnov + * + */ +public enum CaseFileItemTransition { + + addChild, + + addReference, + + create, + + delete, + + removeChild, + + removeReference, + + replace, + + update; + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/Cmmn.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/Cmmn.java new file mode 100644 index 00000000000..ffeaab1a297 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/Cmmn.java @@ -0,0 +1,419 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN10_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.io.OutputStream; + +import org.camunda.bpm.model.cmmn.impl.CmmnParser; +import org.camunda.bpm.model.cmmn.impl.instance.ApplicabilityRuleImpl; +import org.camunda.bpm.model.cmmn.impl.instance.ArtifactImpl; +import org.camunda.bpm.model.cmmn.impl.instance.AssociationImpl; +import org.camunda.bpm.model.cmmn.impl.instance.BindingRefinementExpressionImpl; +import org.camunda.bpm.model.cmmn.impl.instance.BodyImpl; +import org.camunda.bpm.model.cmmn.impl.instance.CaseFileImpl; +import org.camunda.bpm.model.cmmn.impl.instance.CaseFileItemDefinitionImpl; +import org.camunda.bpm.model.cmmn.impl.instance.CaseFileItemImpl; +import org.camunda.bpm.model.cmmn.impl.instance.CaseFileItemOnPartImpl; +import org.camunda.bpm.model.cmmn.impl.instance.CaseFileItemStartTriggerImpl; +import org.camunda.bpm.model.cmmn.impl.instance.CaseFileItemTransitionStandardEventImpl; +import org.camunda.bpm.model.cmmn.impl.instance.CaseFileModelImpl; +import org.camunda.bpm.model.cmmn.impl.instance.CaseImpl; +import org.camunda.bpm.model.cmmn.impl.instance.CaseParameterImpl; +import org.camunda.bpm.model.cmmn.impl.instance.CasePlanModel; +import org.camunda.bpm.model.cmmn.impl.instance.CaseRefExpressionImpl; +import org.camunda.bpm.model.cmmn.impl.instance.CaseRoleImpl; +import org.camunda.bpm.model.cmmn.impl.instance.CaseRolesImpl; +import org.camunda.bpm.model.cmmn.impl.instance.CaseTaskImpl; +import org.camunda.bpm.model.cmmn.impl.instance.ChildrenImpl; +import org.camunda.bpm.model.cmmn.impl.instance.CmmnElementImpl; +import org.camunda.bpm.model.cmmn.impl.instance.ConditionExpressionImpl; +import org.camunda.bpm.model.cmmn.impl.instance.CriterionImpl; +import org.camunda.bpm.model.cmmn.impl.instance.DecisionImpl; +import org.camunda.bpm.model.cmmn.impl.instance.DecisionParameterImpl; +import org.camunda.bpm.model.cmmn.impl.instance.DecisionRefExpressionImpl; +import org.camunda.bpm.model.cmmn.impl.instance.DecisionTaskImpl; +import org.camunda.bpm.model.cmmn.impl.instance.DefaultControlImpl; +import org.camunda.bpm.model.cmmn.impl.instance.DefinitionsImpl; +import org.camunda.bpm.model.cmmn.impl.instance.DiscretionaryItemImpl; +import org.camunda.bpm.model.cmmn.impl.instance.DocumentationImpl; +import org.camunda.bpm.model.cmmn.impl.instance.EntryCriterionImpl; +import org.camunda.bpm.model.cmmn.impl.instance.EventImpl; +import org.camunda.bpm.model.cmmn.impl.instance.EventListenerImpl; +import org.camunda.bpm.model.cmmn.impl.instance.ExitCriterionImpl; +import org.camunda.bpm.model.cmmn.impl.instance.ExpressionImpl; +import org.camunda.bpm.model.cmmn.impl.instance.ExtensionElementsImpl; +import org.camunda.bpm.model.cmmn.impl.instance.HumanTaskImpl; +import org.camunda.bpm.model.cmmn.impl.instance.IfPartImpl; +import org.camunda.bpm.model.cmmn.impl.instance.ImportImpl; +import org.camunda.bpm.model.cmmn.impl.instance.InputCaseParameterImpl; +import org.camunda.bpm.model.cmmn.impl.instance.InputDecisionParameterImpl; +import org.camunda.bpm.model.cmmn.impl.instance.InputProcessParameterImpl; +import org.camunda.bpm.model.cmmn.impl.instance.InputsCaseParameterImpl; +import org.camunda.bpm.model.cmmn.impl.instance.ItemControlImpl; +import org.camunda.bpm.model.cmmn.impl.instance.ManualActivationRuleImpl; +import org.camunda.bpm.model.cmmn.impl.instance.MilestoneImpl; +import org.camunda.bpm.model.cmmn.impl.instance.OnPartImpl; +import org.camunda.bpm.model.cmmn.impl.instance.OutputCaseParameterImpl; +import org.camunda.bpm.model.cmmn.impl.instance.OutputDecisionParameterImpl; +import org.camunda.bpm.model.cmmn.impl.instance.OutputProcessParameterImpl; +import org.camunda.bpm.model.cmmn.impl.instance.OutputsCaseParameterImpl; +import org.camunda.bpm.model.cmmn.impl.instance.ParameterImpl; +import org.camunda.bpm.model.cmmn.impl.instance.ParameterMappingImpl; +import org.camunda.bpm.model.cmmn.impl.instance.PlanFragmentImpl; +import org.camunda.bpm.model.cmmn.impl.instance.PlanItemControlImpl; +import org.camunda.bpm.model.cmmn.impl.instance.PlanItemDefinitionImpl; +import org.camunda.bpm.model.cmmn.impl.instance.PlanItemImpl; +import org.camunda.bpm.model.cmmn.impl.instance.PlanItemOnPartImpl; +import org.camunda.bpm.model.cmmn.impl.instance.PlanItemStartTriggerImpl; +import org.camunda.bpm.model.cmmn.impl.instance.PlanItemTransitionStandardEventImpl; +import org.camunda.bpm.model.cmmn.impl.instance.PlanningTableImpl; +import org.camunda.bpm.model.cmmn.impl.instance.ProcessImpl; +import org.camunda.bpm.model.cmmn.impl.instance.ProcessParameterImpl; +import org.camunda.bpm.model.cmmn.impl.instance.ProcessRefExpressionImpl; +import org.camunda.bpm.model.cmmn.impl.instance.ProcessTaskImpl; +import org.camunda.bpm.model.cmmn.impl.instance.PropertyImpl; +import org.camunda.bpm.model.cmmn.impl.instance.RelationshipImpl; +import org.camunda.bpm.model.cmmn.impl.instance.RepetitionRuleImpl; +import org.camunda.bpm.model.cmmn.impl.instance.RequiredRuleImpl; +import org.camunda.bpm.model.cmmn.impl.instance.RoleImpl; +import org.camunda.bpm.model.cmmn.impl.instance.SentryImpl; +import org.camunda.bpm.model.cmmn.impl.instance.SourceImpl; +import org.camunda.bpm.model.cmmn.impl.instance.StageImpl; +import org.camunda.bpm.model.cmmn.impl.instance.StartTriggerImpl; +import org.camunda.bpm.model.cmmn.impl.instance.TableItemImpl; +import org.camunda.bpm.model.cmmn.impl.instance.TargetImpl; +import org.camunda.bpm.model.cmmn.impl.instance.TaskImpl; +import org.camunda.bpm.model.cmmn.impl.instance.TextAnnotationImpl; +import org.camunda.bpm.model.cmmn.impl.instance.TextImpl; +import org.camunda.bpm.model.cmmn.impl.instance.TimerEventImpl; +import org.camunda.bpm.model.cmmn.impl.instance.TimerEventListenerImpl; +import org.camunda.bpm.model.cmmn.impl.instance.TimerExpressionImpl; +import org.camunda.bpm.model.cmmn.impl.instance.TransformationExpressionImpl; +import org.camunda.bpm.model.cmmn.impl.instance.UserEventImpl; +import org.camunda.bpm.model.cmmn.impl.instance.UserEventListenerImpl; +import org.camunda.bpm.model.cmmn.impl.instance.camunda.CamundaCaseExecutionListenerImpl; +import org.camunda.bpm.model.cmmn.impl.instance.camunda.CamundaExpressionImpl; +import org.camunda.bpm.model.cmmn.impl.instance.camunda.CamundaFieldImpl; +import org.camunda.bpm.model.cmmn.impl.instance.camunda.CamundaInImpl; +import org.camunda.bpm.model.cmmn.impl.instance.camunda.CamundaOutImpl; +import org.camunda.bpm.model.cmmn.impl.instance.camunda.CamundaScriptImpl; +import org.camunda.bpm.model.cmmn.impl.instance.camunda.CamundaStringImpl; +import org.camunda.bpm.model.cmmn.impl.instance.camunda.CamundaTaskListenerImpl; +import org.camunda.bpm.model.cmmn.impl.instance.camunda.CamundaVariableListenerImpl; +import org.camunda.bpm.model.cmmn.impl.instance.camunda.CamundaVariableOnPartImpl; +import org.camunda.bpm.model.cmmn.impl.instance.camunda.CamundaVariableTransitionEventImpl; +import org.camunda.bpm.model.xml.Model; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.ModelException; +import org.camunda.bpm.model.xml.ModelParseException; +import org.camunda.bpm.model.xml.ModelValidationException; +import org.camunda.bpm.model.xml.impl.instance.ModelElementInstanceImpl; +import org.camunda.bpm.model.xml.impl.util.IoUtil; + +/** + * @author Roman Smirnov + * + */ +public class Cmmn { + + /** the singleton instance of {@link Cmmn}. If you want to customize the behavior of Cmmn, + * replace this instance with an instance of a custom subclass of {@link Cmmn}. */ + public static Cmmn INSTANCE = new Cmmn(); + + /** the parser used by the Cmmn implementation. */ + private CmmnParser cmmnParser = new CmmnParser(); + private final ModelBuilder cmmnModelBuilder; + + /** The {@link Model} + */ + private Model cmmnModel; + + /** + * Allows reading a {@link CmmnModelInstance} from a File. + * + * @param file the {@link File} to read the {@link CmmnModelInstance} from + * @return the model read + * @throws CmmnModelException if the model cannot be read + */ + public static CmmnModelInstance readModelFromFile(File file) { + return INSTANCE.doReadModelFromFile(file); + } + + /** + * Allows reading a {@link CmmnModelInstance} from an {@link InputStream} + * + * @param stream the {@link InputStream} to read the {@link CmmnModelInstance} from + * @return the model read + * @throws ModelParseException if the model cannot be read + */ + public static CmmnModelInstance readModelFromStream(InputStream stream) { + return INSTANCE.doReadModelFromInputStream(stream); + } + + /** + * Allows writing a {@link CmmnModelInstance} to a File. It will be + * validated before writing. + * + * @param file the {@link File} to write the {@link CmmnModelInstance} to + * @param modelInstance the {@link CmmnModelInstance} to write + * @throws CmmnModelException if the model cannot be written + * @throws ModelValidationException if the model is not valid + */ + public static void writeModelToFile(File file, CmmnModelInstance modelInstance) { + INSTANCE.doWriteModelToFile(file, modelInstance); + } + + /** + * Allows writing a {@link CmmnModelInstance} to an {@link OutputStream}. It will be + * validated before writing. + * + * @param stream the {@link OutputStream} to write the {@link CmmnModelInstance} to + * @param modelInstance the {@link CmmnModelInstance} to write + * @throws ModelException if the model cannot be written + * @throws ModelValidationException if the model is not valid + */ + public static void writeModelToStream(OutputStream stream, CmmnModelInstance modelInstance) { + INSTANCE.doWriteModelToOutputStream(stream, modelInstance); + } + + /** + * Allows the conversion of a {@link CmmnModelInstance} to an {@link String}. It will + * be validated before conversion. + * + * @param modelInstance the model instance to convert + * @return the XML string representation of the model instance + */ + public static String convertToString(CmmnModelInstance modelInstance) { + return INSTANCE.doConvertToString(modelInstance); + } + + /** + * Validate model DOM document + * + * @param modelInstance the {@link CmmnModelInstance} to validate + * @throws ModelValidationException if the model is not valid + */ + public static void validateModel(CmmnModelInstance modelInstance) { + INSTANCE.doValidateModel(modelInstance); + } + + /** + * Allows creating an new, empty {@link CmmnModelInstance}. + * + * @return the empty model. + */ + public static CmmnModelInstance createEmptyModel() { + return INSTANCE.doCreateEmptyModel(); + } + + /** + * Register known types of the Cmmn model + */ + protected Cmmn() { + cmmnModelBuilder = ModelBuilder.createInstance("CMMN Model"); + cmmnModelBuilder.alternativeNamespace(CMMN10_NS, CMMN11_NS); + doRegisterTypes(cmmnModelBuilder); + cmmnModel = cmmnModelBuilder.build(); + } + + protected CmmnModelInstance doReadModelFromFile(File file) { + InputStream is = null; + try { + is = new FileInputStream(file); + return doReadModelFromInputStream(is); + + } catch (FileNotFoundException e) { + throw new CmmnModelException("Cannot read model from file "+file+": file does not exist."); + + } finally { + IoUtil.closeSilently(is); + + } + } + + protected CmmnModelInstance doReadModelFromInputStream(InputStream is) { + return cmmnParser.parseModelFromStream(is); + } + + protected void doWriteModelToFile(File file, CmmnModelInstance modelInstance) { + OutputStream os = null; + try { + os = new FileOutputStream(file); + doWriteModelToOutputStream(os, modelInstance); + } + catch (FileNotFoundException e) { + throw new CmmnModelException("Cannot write model to file "+file+": file does not exist."); + } finally { + IoUtil.closeSilently(os); + } + } + + protected void doWriteModelToOutputStream(OutputStream os, CmmnModelInstance modelInstance) { + // validate DOM document + doValidateModel(modelInstance); + // write XML + IoUtil.writeDocumentToOutputStream(modelInstance.getDocument(), os); + } + + protected String doConvertToString(CmmnModelInstance modelInstance) { + // validate DOM document + doValidateModel(modelInstance); + // convert to XML string + return IoUtil.convertXmlDocumentToString(modelInstance.getDocument()); + } + + protected void doValidateModel(CmmnModelInstance modelInstance) { + cmmnParser.validateModel(modelInstance.getDocument()); + } + + protected CmmnModelInstance doCreateEmptyModel() { + return cmmnParser.getEmptyModel(); + } + + protected void doRegisterTypes(ModelBuilder modelBuilder) { + ArtifactImpl.registerType(modelBuilder); + ApplicabilityRuleImpl.registerType(modelBuilder); + AssociationImpl.registerType(modelBuilder); + BindingRefinementExpressionImpl.registerType(modelBuilder); + BodyImpl.registerType(modelBuilder); + CaseFileImpl.registerType(modelBuilder); + CaseFileItemDefinitionImpl.registerType(modelBuilder); + CaseFileItemImpl.registerType(modelBuilder); + CaseFileItemOnPartImpl.registerType(modelBuilder); + CaseFileItemStartTriggerImpl.registerType(modelBuilder); + CaseFileItemTransitionStandardEventImpl.registerType(modelBuilder); + CaseFileModelImpl.registerType(modelBuilder); + CaseImpl.registerType(modelBuilder); + CaseParameterImpl.registerType(modelBuilder); + CasePlanModel.registerType(modelBuilder); + CaseRoleImpl.registerType(modelBuilder); + CaseRolesImpl.registerType(modelBuilder); + CaseRefExpressionImpl.registerType(modelBuilder); + CaseTaskImpl.registerType(modelBuilder); + ChildrenImpl.registerType(modelBuilder); + CmmnElementImpl.registerType(modelBuilder); + ConditionExpressionImpl.registerType(modelBuilder); + CriterionImpl.registerType(modelBuilder); + DecisionImpl.registerType(modelBuilder); + DecisionParameterImpl.registerType(modelBuilder); + DecisionRefExpressionImpl.registerType(modelBuilder); + DecisionTaskImpl.registerType(modelBuilder); + DefaultControlImpl.registerType(modelBuilder); + DefinitionsImpl.registerType(modelBuilder); + DiscretionaryItemImpl.registerType(modelBuilder); + DocumentationImpl.registerType(modelBuilder); + EntryCriterionImpl.registerType(modelBuilder); + EventImpl.registerType(modelBuilder); + EventListenerImpl.registerType(modelBuilder); + ExitCriterionImpl.registerType(modelBuilder); + ExpressionImpl.registerType(modelBuilder); + ExtensionElementsImpl.registerType(modelBuilder); + HumanTaskImpl.registerType(modelBuilder); + IfPartImpl.registerType(modelBuilder); + ImportImpl.registerType(modelBuilder); + InputCaseParameterImpl.registerType(modelBuilder); + InputProcessParameterImpl.registerType(modelBuilder); + InputsCaseParameterImpl.registerType(modelBuilder); + InputDecisionParameterImpl.registerType(modelBuilder); + InputProcessParameterImpl.registerType(modelBuilder); + ItemControlImpl.registerType(modelBuilder); + ManualActivationRuleImpl.registerType(modelBuilder); + MilestoneImpl.registerType(modelBuilder); + ModelElementInstanceImpl.registerType(modelBuilder); + OnPartImpl.registerType(modelBuilder); + OutputCaseParameterImpl.registerType(modelBuilder); + OutputProcessParameterImpl.registerType(modelBuilder); + OutputsCaseParameterImpl.registerType(modelBuilder); + OutputDecisionParameterImpl.registerType(modelBuilder); + OutputProcessParameterImpl.registerType(modelBuilder); + ParameterImpl.registerType(modelBuilder); + ParameterMappingImpl.registerType(modelBuilder); + PlanFragmentImpl.registerType(modelBuilder); + PlanItemControlImpl.registerType(modelBuilder); + PlanItemDefinitionImpl.registerType(modelBuilder); + PlanItemImpl.registerType(modelBuilder); + PlanItemOnPartImpl.registerType(modelBuilder); + PlanItemStartTriggerImpl.registerType(modelBuilder); + PlanItemTransitionStandardEventImpl.registerType(modelBuilder); + PlanningTableImpl.registerType(modelBuilder); + ProcessImpl.registerType(modelBuilder); + ProcessParameterImpl.registerType(modelBuilder); + ProcessRefExpressionImpl.registerType(modelBuilder); + ProcessTaskImpl.registerType(modelBuilder); + PropertyImpl.registerType(modelBuilder); + RelationshipImpl.registerType(modelBuilder); + RepetitionRuleImpl.registerType(modelBuilder); + RequiredRuleImpl.registerType(modelBuilder); + RoleImpl.registerType(modelBuilder); + SentryImpl.registerType(modelBuilder); + SourceImpl.registerType(modelBuilder); + StageImpl.registerType(modelBuilder); + StartTriggerImpl.registerType(modelBuilder); + TableItemImpl.registerType(modelBuilder); + TargetImpl.registerType(modelBuilder); + TaskImpl.registerType(modelBuilder); + TextAnnotationImpl.registerType(modelBuilder); + TextImpl.registerType(modelBuilder); + TimerEventImpl.registerType(modelBuilder); + TimerEventListenerImpl.registerType(modelBuilder); + TransformationExpressionImpl.registerType(modelBuilder); + TimerExpressionImpl.registerType(modelBuilder); + TransformationExpressionImpl.registerType(modelBuilder); + UserEventImpl.registerType(modelBuilder); + UserEventListenerImpl.registerType(modelBuilder); + + /** camunda extensions */ + CamundaCaseExecutionListenerImpl.registerType(modelBuilder); + CamundaExpressionImpl.registerType(modelBuilder); + CamundaFieldImpl.registerType(modelBuilder); + CamundaInImpl.registerType(modelBuilder); + CamundaOutImpl.registerType(modelBuilder); + CamundaScriptImpl.registerType(modelBuilder); + CamundaStringImpl.registerType(modelBuilder); + CamundaTaskListenerImpl.registerType(modelBuilder); + CamundaVariableListenerImpl.registerType(modelBuilder); + CamundaVariableOnPartImpl.registerType(modelBuilder); + CamundaVariableTransitionEventImpl.registerType(modelBuilder); + } + + /** + * @return the {@link Model} instance to use + */ + public Model getCmmnModel() { + return cmmnModel; + } + + public ModelBuilder getCmmnModelBuilder() { + return cmmnModelBuilder; + } + + /** + * @param cmmnModel the cmmnModel to set + */ + public void setCmmnModel(Model cmmnModel) { + this.cmmnModel = cmmnModel; + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/CmmnModelException.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/CmmnModelException.java new file mode 100644 index 00000000000..944d4969924 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/CmmnModelException.java @@ -0,0 +1,44 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn; + +import org.camunda.bpm.model.xml.ModelException; + +/** + * @author Roman Smirnov + * + */ +public class CmmnModelException extends ModelException { + + private static final long serialVersionUID = 1L; + + public CmmnModelException() { + } + + public CmmnModelException(String message, Throwable cause) { + super(message, cause); + } + + public CmmnModelException(String message) { + super(message); + } + + public CmmnModelException(Throwable cause) { + super(cause); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/CmmnModelInstance.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/CmmnModelInstance.java new file mode 100644 index 00000000000..8a373bd0d22 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/CmmnModelInstance.java @@ -0,0 +1,47 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn; + +import org.camunda.bpm.model.cmmn.instance.Definitions; +import org.camunda.bpm.model.xml.ModelInstance; + +/** + * @author Roman Smirnov + * + */ +public interface CmmnModelInstance extends ModelInstance { + + /** + * @return the {@link Definitions}, root element of the Cmmn Model. + * */ + Definitions getDefinitions(); + + /** + * Set the Cmmn Definitions Root element + * @param definitions the {@link Definitions} element to set + * */ + void setDefinitions(Definitions definitions); + + /** + * Copies the CMMN model instance but not the model. So only the wrapped DOM document is cloned. + * Changes of the model are persistent between multiple model instances. + * + * @return the new CMMN model instance + */ + CmmnModelInstance clone(); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/MultiplicityEnum.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/MultiplicityEnum.java new file mode 100644 index 00000000000..a4847f699ad --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/MultiplicityEnum.java @@ -0,0 +1,37 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn; + +/** + * @author Roman Smirnov + * + */ +public enum MultiplicityEnum { + + ZeroOrOne, + + ZeroOrMore, + + ExactlyOne, + + OneOrMore, + + Unspecified, + + Unknown + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/PlanItemTransition.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/PlanItemTransition.java new file mode 100644 index 00000000000..53c47bce586 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/PlanItemTransition.java @@ -0,0 +1,60 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn; + +/** + * @author Roman Smirnov + * + */ +public enum PlanItemTransition { + + close, + + complete, + + create, + + disable, + + enable, + + exit, + + fault, + + manualStart, + + occur, + + parentResume, + + parentSuspend, + + reactivate, + + reenable, + + resume, + + start, + + suspend, + + terminate; + + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/Query.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/Query.java new file mode 100644 index 00000000000..3a5fe17c60d --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/Query.java @@ -0,0 +1,40 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn; + +import java.util.List; + +import org.camunda.bpm.model.xml.instance.ModelElementInstance; +import org.camunda.bpm.model.xml.type.ModelElementType; + +/** + * @author Sebastian Menski + * @author Roman Smirnov + */ +public interface Query { + + List list(); + + int count(); + + Query filterByType(ModelElementType elementType); + + Query filterByType(Class elementClass); + + T singleResult(); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/RelationshipDirection.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/RelationshipDirection.java new file mode 100644 index 00000000000..b123d96d1ee --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/RelationshipDirection.java @@ -0,0 +1,27 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn; + +/** + * @author Roman Smirnov + */ +public enum RelationshipDirection { + None, + Forward, + Backward, + Both +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/VariableTransition.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/VariableTransition.java new file mode 100644 index 00000000000..3e68acb43c4 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/VariableTransition.java @@ -0,0 +1,31 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn; + +/** + * @author Deivarayan Azhagappan + * + */ +public enum VariableTransition { + + create, + + update, + + delete; + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/CmmnModelConstants.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/CmmnModelConstants.java new file mode 100644 index 00000000000..cee8d5fd8c4 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/CmmnModelConstants.java @@ -0,0 +1,266 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl; + +/** + * @author Roman Smirnov + * + */ +public class CmmnModelConstants { + + /** The CMMN 1.0 namespace */ + public static final String CMMN10_NS = "http://www.omg.org/spec/CMMN/20131201/MODEL"; + + /** The CMMN 1.1 namespace */ + public static final String CMMN11_NS = "http://www.omg.org/spec/CMMN/20151109/MODEL"; + + /** The location of the CMMN 1.0 XML schema. */ + public static final String CMMN_10_SCHEMA_LOCATION = "cmmn10/CMMN10.xsd"; + + /** The location of the CMMN 1.1 XML schema. */ + public static final String CMMN_11_SCHEMA_LOCATION = "cmmn11/CMMN11.xsd"; + + /** Xml Schema is the default type language */ + public static final String XML_SCHEMA_NS = "http://www.w3.org/2001/XMLSchema"; + + public static final String XPATH_NS = "http://www.w3.org/1999/XPath"; + + /** Camunda namespace */ + public static final String CAMUNDA_NS = "http://camunda.org/schema/1.0/cmmn"; + + // elements /////////////////////////////////////////////////////////////////////////// + + public static final String CMMN_ELEMENT = "cmmnElement"; + public static final String CMMN_ELEMENT_DEFINITIONS = "definitions"; + public static final String CMMN_ELEMENT_IMPORT = "import"; + public static final String CMMN_ELEMENT_EXTENSION_ELEMENTS= "extensionElements"; + public static final String CMMN_ELEMENT_DOCUMENTATION = "documentation"; + + // artifact + public static final String CMMN_ELEMENT_ARTIFACT = "artifact"; + public static final String CMMN_ELEMENT_ASSOCIATION = "association"; + public static final String CMMN_ELEMENT_TEXT_ANNOTATION = "textAnnotation"; + public static final String CMMN_ELEMENT_TEXT = "text"; + + // relationship + public static final String CMMN_ELEMENT_RELATIONSHIP = "relationship"; + public static final String CMMN_ELEMENT_SOURCE = "source"; + public static final String CMMN_ELEMENT_TARGET = "target"; + + // case + public static final String CMMN_ELEMENT_CASE = "case"; + public static final String CMMN_ELEMENT_CASE_FILE_MODEL = "caseFileModel"; + public static final String CMMN_ELEMENT_CASE_PLAN_MODEL = "casePlanModel"; + + // roles + public static final String CMMN_ELEMENT_ROLE = "role"; + public static final String CMMN_ELEMENT_CASE_ROLE = "caseRole"; + public static final String CMMN_ELEMENT_CASE_ROLES = "caseRoles"; + + // rules + public static final String CMMN_ELEMENT_REPETITION_RULE = "repetitionRule"; + public static final String CMMN_ELEMENT_REQUIRED_RULE = "requiredRule"; + public static final String CMMN_ELEMENT_MANUAL_ACTIVATION_RULE = "manualActivationRule"; + public static final String CMMN_ELEMENT_APPLICABILITY_RULE= "applicabilityRule"; + + // expression + public static final String CMMN_ELEMENT_EXPRESSION = "expression"; + public static final String CMMN_ELEMENT_BODY = "body"; + public static final String CMMN_ELEMENT_CONDITION = "condition"; + public static final String CMMN_ELEMENT_BINDING_REFINEMENT = "bindingRefinement"; + public static final String CMMN_ELEMENT_TRANSFORMATION = "transformation"; + public static final String CMMN_ELEMENT_TIMER_EXPRESSION = "timerExpression"; + public static final String CMMN_ELEMENT_CASE_REF_EXPRESSION = "caseRefExpression"; + public static final String CMMN_ELEMENT_DECISION_REF_EXPRESSION = "decisionRefExpression"; + public static final String CMMN_ELEMENT_PROCESS_REF_EXPRESSION = "processRefExpression"; + + // case file + public static final String CMMN_ELEMENT_CASE_FILE = "caseFile"; + public static final String CMMN_ELEMENT_CASE_FILE_ITEM = "caseFileItem"; + public static final String CMMN_ELEMENT_CASE_FILE_ITEM_DEFINITION = "caseFileItemDefinition"; + public static final String CMMN_ELEMENT_CHILDREN = "children"; + + // plan item control + public static final String CMMN_ELEMENT_PLAN_ITEM_CONTROL = "planItemControl"; + public static final String CMMN_ELEMENT_DEFAULT_CONTROL = "defaultControl"; + public static final String CMMN_ELEMENT_ITEM_CONTROL = "itemControl"; + + // plan item definitions + public static final String CMMN_ELEMENT_PLAN_ITEM_DEFINITION = "planItemDefinition"; + // tasks + public static final String CMMN_ELEMENT_TASK = "task"; + public static final String CMMN_ELEMENT_HUMAN_TASK = "humanTask"; + public static final String CMMN_ELEMENT_PROCESS_TASK = "processTask"; + public static final String CMMN_ELEMENT_CASE_TASK = "caseTask"; + public static final String CMMN_ELEMENT_DECISION_TASK = "decisionTask"; + // events + public static final String CMMN_ELEMENT_EVENT = "event"; + public static final String CMMN_ELEMENT_USER_EVENT = "userEvent"; + public static final String CMMN_ELEMENT_TIMER_EVENT = "timerEvent"; + // event listeners + public static final String CMMN_ELEMENT_EVENT_LISTENER = "eventListener"; + public static final String CMMN_ELEMENT_USER_EVENT_LISTENER = "userEventListener"; + public static final String CMMN_ELEMENT_TIMER_EVENT_LISTENER = "timerEventListener"; + // milestones + public static final String CMMN_ELEMENT_MILESTONE = "milestone"; + // plan fragment + public static final String CMMN_ELEMENT_PLAN_FRAGMENT = "planFragment"; + // stage + public static final String CMMN_ELEMENT_STAGE = "stage"; + + // plan item + public static final String CMMN_ELEMENT_PLAN_ITEM = "planItem"; + + // table items + public static final String CMMN_ELEMENT_TABLE_ITEM = "tableItem"; + public static final String CMMN_ELEMENT_PLANNING_TABLE = "planningTable"; + public static final String CMMN_ELEMENT_DISCRETIONARY_ITEM = "discretionaryItem"; + + // start trigger + public static final String CMMN_ELEMENT_TIMER_START = "timerStart"; + public static final String CMMN_ELEMENT_CASE_FILE_ITEM_START_TRIGGER = "caseFileItemStartTrigger"; + public static final String CMMN_ELEMENT_PLAN_ITEM_START_TRIGGER = "planItemStartTrigger"; + + // sentrys + public static final String CMMN_ELEMENT_SENTRY = "sentry"; + public static final String CMMN_ELEMENT_STANDARD_EVENT = "standardEvent"; + public static final String CMMN_ELEMENT_ON_PART = "onPart"; + public static final String CMMN_ELEMENT_CASE_FILE_ITEM_ON_PART = "caseFileItemOnPart"; + public static final String CMMN_ELEMENT_PLAN_ITEM_ON_PART = "planItemOnPart"; + public static final String CMMN_ELEMENT_IF_PART = "ifPart"; + + // criterion + public static final String CMMN_ELEMENT_CRITERION = "criterion"; + public static final String CMMN_ELEMENT_ENTRY_CRITERION = "entryCriterion"; + public static final String CMMN_ELEMENT_EXIT_CRITERION = "exitCriterion"; + + // parameter + public static final String CMMN_ELEMENT_PARAMETER = "parameter"; + public static final String CMMN_ELEMENT_CASE_PARAMETER = "caseParameter"; + public static final String CMMN_ELEMENT_PROCESS_PARAMETER = "processParameter"; + public static final String CMMN_ELEMENT_DECISION_PARAMETER = "decisionParameter"; + public static final String CMMN_ELEMENT_INPUT = "input"; + public static final String CMMN_ELEMENT_INPUTS = "inputs"; + public static final String CMMN_ELEMENT_OUTPUT = "output"; + public static final String CMMN_ELEMENT_OUTPUTS = "outputs"; + public static final String CMMN_ELEMENT_PARAMETER_MAPPING = "parameterMapping"; + + // property + public static final String CMMN_ELEMENT_PROPERTY = "property"; + + // process + public static final String CMMN_ELEMENT_PROCESS = "process"; + + // decision + public static final String CMMN_ELEMENT_DECISION = "decision"; + + // camunda elements + public static final String CAMUNDA_ELEMENT_IN = "in"; + public static final String CAMUNDA_ELEMENT_OUT = "out"; + public static final String CAMUNDA_ELEMENT_TASK_LISTENER = "taskListener"; + public static final String CAMUNDA_ELEMENT_CASE_EXECUTION_LISTENER = "caseExecutionListener"; + public static final String CAMUNDA_ELEMENT_VARIABLE_LISTENER = "variableListener"; + public static final String CAMUNDA_ELEMENT_FIELD = "field"; + public static final String CAMUNDA_ELEMENT_EXPRESSION = "expression"; + public static final String CAMUNDA_ELEMENT_STRING = "string"; + public static final String CAMUNDA_ELEMENT_SCRIPT = "script"; + public static final String CAMUNDA_ELEMENT_VARIABLE_ON_PART = "variableOnPart"; + public static final String CAMUNDA_ELEMENT_VARIABLE_EVENT = "variableEvent"; + + // attributes ///////////////////////////////////////////////////////////////////////// + + public static final String CMMN_ATTRIBUTE_ID = "id"; + public static final String CMMN_ATTRIBUTE_DESCRIPTION = "description"; + public static final String CMMN_ATTRIBUTE_NAME = "name"; + public static final String CMMN_ATTRIBUTE_TYPE = "type"; + public static final String CMMN_ATTRIBUTE_TARGET_NAMESPACE = "targetNamespace"; + public static final String CMMN_ATTRIBUTE_EXPRESSION_LANGUAGE = "expressionLanguage"; + public static final String CMMN_ATTRIBUTE_EXPORTER = "exporter"; + public static final String CMMN_ATTRIBUTE_EXPORTER_VERSION = "exporterVersion"; + public static final String CMMN_ATTRIBUTE_AUTHOR = "author"; + public static final String CMMN_ATTRIBUTE_CREATION_DATE = "creationDate"; + public static final String CMMN_ATTRIBUTE_LOCATION = "location"; + public static final String CMMN_ATTRIBUTE_NAMESPACE = "namespace"; + public static final String CMMN_ATTRIBUTE_IMPORT_TYPE = "importType"; + public static final String CMMN_ATTRIBUTE_MULTIPLICITY = "multiplicity"; + public static final String CMMN_ATTRIBUTE_DEFINITION_REF = "definitionRef"; + public static final String CMMN_ATTRIBUTE_SOURCE_REF = "sourceRef"; + public static final String CMMN_ATTRIBUTE_SOURCE_REFS = "sourceRefs"; + public static final String CMMN_ATTRIBUTE_TARGET_REFS = "targetRefs"; + public static final String CMMN_ATTRIBUTE_DEFINITION_TYPE = "definitionType"; + public static final String CMMN_ATTRIBUTE_STRUCTURE_REF = "structureRef"; + public static final String CMMN_ATTRIBUTE_IMPORT_REF = "importRef"; + public static final String CMMN_ATTRIBUTE_LANGUAGE = "language"; + public static final String CMMN_ATTRIBUTE_IS_BLOCKING = "isBlocking"; + public static final String CMMN_ATTRIBUTE_BINDING_REF= "bindingRef"; + public static final String CMMN_ATTRIBUTE_PERFORMER_REF = "performerRef"; + public static final String CMMN_ATTRIBUTE_PROCESS_REF = "processRef"; + public static final String CMMN_ATTRIBUTE_IMPLEMENTATION_TYPE = "implementationType"; + public static final String CMMN_ATTRIBUTE_CASE_REF = "caseRef"; + public static final String CMMN_ATTRIBUTE_TARGET_REF = "targetRef"; + public static final String CMMN_ATTRIBUTE_SENTRY_REF = "sentryRef"; + public static final String CMMN_ATTRIBUTE_CONTEXT_REF = "contextRef"; + public static final String CMMN_ATTRIBUTE_AUTO_COMPLETE = "autoComplete"; + public static final String CMMN_ATTRIBUTE_ENTRY_CRITERIA_REFS = "entryCriteriaRefs"; + public static final String CMMN_ATTRIBUTE_EXIT_CRITERIA_REFS = "exitCriteriaRefs"; + public static final String CMMN_ATTRIBUTE_APPLICABILITY_RULE_REFS = "applicabilityRuleRefs"; + public static final String CMMN_ATTRIBUTE_AUTHORIZED_ROLE_REFS = "authorizedRoleRefs"; + public static final String CMMN_ATTRIBUTE_DIRECTION = "direction"; + public static final String CMMN_ATTRIBUTE_TEXT_FORMAT = "textFormat"; + public static final String CMMN_ATTRIBUTE_DECISION_REF = "decisionRef"; + public static final String CMMN_ATTRIBUTE_ASSOCIATION_DIRECTION = "associationDirection"; + public static final String CMMN_ATTRIBUTE_EXIT_CRITERION_REF = "exitCriterionRef"; + + // camunda attribute extensions //////////////////////////////////////////////////// + + public static final String CAMUNDA_ATTRIBUTE_ASSIGNEE = "assignee"; + public static final String CAMUNDA_ATTRIBUTE_CANDIDATE_GROUPS = "candidateGroups"; + public static final String CAMUNDA_ATTRIBUTE_CANDIDATE_USERS = "candidateUsers"; + public static final String CAMUNDA_ATTRIBUTE_DUE_DATE = "dueDate"; + public static final String CAMUNDA_ATTRIBUTE_FOLLOW_UP_DATE = "followUpDate"; + public static final String CAMUNDA_ATTRIBUTE_FORM_KEY = "formKey"; + public static final String CAMUNDA_ATTRIBUTE_PRIORITY = "priority"; + public static final String CAMUNDA_ATTRIBUTE_SOURCE = "source"; + public static final String CAMUNDA_ATTRIBUTE_SOURCE_EXPRESSION = "sourceExpression"; + public static final String CAMUNDA_ATTRIBUTE_BUSINESS_KEY = "businessKey"; + public static final String CAMUNDA_ATTRIBUTE_LOCAL = "local"; + public static final String CAMUNDA_ATTRIBUTE_TARGET = "target"; + public static final String CAMUNDA_ATTRIBUTE_VARIABLES = "variables"; + public static final String CAMUNDA_ATTRIBUTE_PROCESS_BINDING = "processBinding"; + public static final String CAMUNDA_ATTRIBUTE_PROCESS_VERSION = "processVersion"; + public static final String CAMUNDA_ATTRIBUTE_PROCESS_TENANT_ID = "processTenantId"; + public static final String CAMUNDA_ATTRIBUTE_CASE_BINDING = "caseBinding"; + public static final String CAMUNDA_ATTRIBUTE_CASE_VERSION = "caseVersion"; + public static final String CAMUNDA_ATTRIBUTE_CASE_TENANT_ID = "caseTenantId"; + public static final String CAMUNDA_ATTRIBUTE_EVENT = "event"; + public static final String CAMUNDA_ATTRIBUTE_CLASS = "class"; + public static final String CAMUNDA_ATTRIBUTE_EXPRESSION = "expression"; + public static final String CAMUNDA_ATTRIBUTE_DELEGATE_EXPRESSION = "delegateExpression"; + public static final String CAMUNDA_ATTRIBUTE_STRING_VALUE = "stringValue"; + public static final String CAMUNDA_ATTRIBUTE_NAME = "name"; + public static final String CAMUNDA_ATTRIBUTE_SCRIPT_FORMAT = "scriptFormat"; + public static final String CAMUNDA_ATTRIBUTE_RESOURCE = "resource"; + public static final String CAMUNDA_ATTRIBUTE_REPEAT_ON_STANDARD_EVENT = "repeatOnStandardEvent"; + public static final String CAMUNDA_ATTRIBUTE_RESULT_VARIABLE = "resultVariable"; + public static final String CAMUNDA_ATTRIBUTE_DECISION_BINDING = "decisionBinding"; + public static final String CAMUNDA_ATTRIBUTE_DECISION_VERSION = "decisionVersion"; + public static final String CAMUNDA_ATTRIBUTE_DECISION_TENANT_ID = "decisionTenantId"; + public static final String CAMUNDA_ATTRIBUTE_MAP_DECISION_RESULT = "mapDecisionResult"; + public static final String CAMUNDA_ATTRIBUTE_VARIABLE_NAME = "variableName"; + public static final String CAMUNDA_ATTRIBUTE_HISTORY_TIME_TO_LIVE = "historyTimeToLive"; + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/CmmnModelInstanceImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/CmmnModelInstanceImpl.java new file mode 100644 index 00000000000..434c227c879 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/CmmnModelInstanceImpl.java @@ -0,0 +1,49 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl; + +import org.camunda.bpm.model.cmmn.CmmnModelInstance; +import org.camunda.bpm.model.cmmn.instance.Definitions; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.ModelImpl; +import org.camunda.bpm.model.xml.impl.ModelInstanceImpl; +import org.camunda.bpm.model.xml.instance.DomDocument; + +/** + * @author Roman Smirnov + * + */ +public class CmmnModelInstanceImpl extends ModelInstanceImpl implements CmmnModelInstance { + + public CmmnModelInstanceImpl(ModelImpl model, ModelBuilder modelBuilder, DomDocument document) { + super(model, modelBuilder, document); + } + + public Definitions getDefinitions() { + return (Definitions) getDocumentElement(); + } + + public void setDefinitions(Definitions definitions) { + setDocumentElement(definitions); + } + + @Override + public CmmnModelInstance clone() { + return new CmmnModelInstanceImpl(model, modelBuilder, document.clone()); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/CmmnParser.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/CmmnParser.java new file mode 100644 index 00000000000..a1986e6d986 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/CmmnParser.java @@ -0,0 +1,87 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN10_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_10_SCHEMA_LOCATION; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_11_SCHEMA_LOCATION; + +import java.io.InputStream; + +import org.camunda.bpm.model.cmmn.Cmmn; +import org.camunda.bpm.model.cmmn.CmmnModelException; +import org.camunda.bpm.model.xml.ModelParseException; +import org.camunda.bpm.model.xml.impl.ModelImpl; +import org.camunda.bpm.model.xml.impl.parser.AbstractModelParser; +import org.camunda.bpm.model.xml.impl.util.ReflectUtil; +import org.camunda.bpm.model.xml.instance.DomDocument; + +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.validation.SchemaFactory; + +/** + * @author Roman Smirnov + * + */ +public class CmmnParser extends AbstractModelParser { + + private static final String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + private static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + + private static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema"; + + public CmmnParser() { + this.schemaFactory = SchemaFactory.newInstance(W3C_XML_SCHEMA); + addSchema(CMMN10_NS, createSchema(CMMN_10_SCHEMA_LOCATION, CmmnParser.class.getClassLoader())); + addSchema(CMMN11_NS, createSchema(CMMN_11_SCHEMA_LOCATION, CmmnParser.class.getClassLoader())); + } + + @Override + protected void configureFactory(DocumentBuilderFactory dbf) { + dbf.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA); + + ClassLoader classLoader = CmmnParser.class.getClassLoader(); + dbf.setAttribute(JAXP_SCHEMA_SOURCE, new String[] { + ReflectUtil.getResource(CMMN_10_SCHEMA_LOCATION, classLoader).toString(), + ReflectUtil.getResource(CMMN_11_SCHEMA_LOCATION, classLoader).toString() } + ); + + super.configureFactory(dbf); + } + + @Override + protected CmmnModelInstanceImpl createModelInstance(DomDocument document) { + return new CmmnModelInstanceImpl((ModelImpl) Cmmn.INSTANCE.getCmmnModel(), Cmmn.INSTANCE.getCmmnModelBuilder(), document); + } + + @Override + public CmmnModelInstanceImpl parseModelFromStream(InputStream inputStream) { + try { + return (CmmnModelInstanceImpl) super.parseModelFromStream(inputStream); + } + catch (ModelParseException e) { + throw new CmmnModelException("Unable to parse model", e); + } + } + + @Override + public CmmnModelInstanceImpl getEmptyModel() { + return (CmmnModelInstanceImpl) super.getEmptyModel(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/QueryImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/QueryImpl.java new file mode 100644 index 00000000000..a595430a5da --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/QueryImpl.java @@ -0,0 +1,72 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import org.camunda.bpm.model.cmmn.CmmnModelException; +import org.camunda.bpm.model.cmmn.Query; +import org.camunda.bpm.model.xml.instance.ModelElementInstance; +import org.camunda.bpm.model.xml.type.ModelElementType; + +/** + * @author Sebastian Menski + */ +public class QueryImpl implements Query { + + private final Collection collection; + + public QueryImpl(Collection collection) { + this.collection = collection; + } + + public List list() { + return new ArrayList(collection); + } + + public int count() { + return collection.size(); + } + + @SuppressWarnings("unchecked") + public Query filterByType(ModelElementType elementType) { + Class elementClass = (Class) elementType.getInstanceType(); + return filterByType(elementClass); + } + + @SuppressWarnings("unchecked") + public Query filterByType(Class elementClass) { + List filtered = new ArrayList(); + for (T instance : collection) { + if (elementClass.isAssignableFrom(instance.getClass())) { + filtered.add((V) instance); + } + } + return new QueryImpl(filtered); + } + + public T singleResult() { + if (collection.size() == 1) { + return collection.iterator().next(); + } + else { + throw new CmmnModelException("Collection expected to have <1> entry but has <" + collection.size() + ">"); + } + } +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ApplicabilityRuleImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ApplicabilityRuleImpl.java new file mode 100644 index 00000000000..e3a10bb4ddc --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ApplicabilityRuleImpl.java @@ -0,0 +1,102 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_CONTEXT_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_NAME; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_APPLICABILITY_RULE; + +import org.camunda.bpm.model.cmmn.instance.ApplicabilityRule; +import org.camunda.bpm.model.cmmn.instance.CaseFileItem; +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.cmmn.instance.ConditionExpression; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; +import org.camunda.bpm.model.xml.type.reference.AttributeReference; + +/** + * @author Roman Smirnov + * + */ +public class ApplicabilityRuleImpl extends CmmnElementImpl implements ApplicabilityRule { + + protected static AttributeReference contextRefAttribute; + protected static ChildElement conditionChild; + + // cmmn 1.1 + protected static Attribute nameAttribute; + + public ApplicabilityRuleImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getName() { + return nameAttribute.getValue(this); + } + + public void setName(String name) { + nameAttribute.setValue(this, name); + } + + public CaseFileItem getContext() { + return contextRefAttribute.getReferenceTargetElement(this); + } + + public void setContext(CaseFileItem context) { + contextRefAttribute.setReferenceTargetElement(this, context); + } + + public ConditionExpression getCondition() { + return conditionChild.getChild(this); + } + + public void setCondition(ConditionExpression expression) { + conditionChild.setChild(this, expression); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(ApplicabilityRule.class, CMMN_ELEMENT_APPLICABILITY_RULE) + .namespaceUri(CMMN11_NS) + .extendsType(CmmnElement.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public ApplicabilityRule newInstance(ModelTypeInstanceContext instanceContext) { + return new ApplicabilityRuleImpl(instanceContext); + } + }); + + nameAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_NAME) + .build(); + + contextRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_CONTEXT_REF) + .idAttributeReference(CaseFileItem.class) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + conditionChild = sequenceBuilder.element(ConditionExpression.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ArtifactImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ArtifactImpl.java new file mode 100644 index 00000000000..ca3f849b47b --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ArtifactImpl.java @@ -0,0 +1,45 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_ARTIFACT; + +import org.camunda.bpm.model.cmmn.instance.Artifact; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; + +/** + * @author Roman Smirnov + * + */ +public abstract class ArtifactImpl extends CmmnElementImpl implements Artifact { + + public ArtifactImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Artifact.class, CMMN_ELEMENT_ARTIFACT) + .abstractType() + .namespaceUri(CMMN11_NS); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/AssociationImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/AssociationImpl.java new file mode 100644 index 00000000000..35f8757e36b --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/AssociationImpl.java @@ -0,0 +1,98 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_ASSOCIATION_DIRECTION; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_SOURCE_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_TARGET_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_ASSOCIATION; + +import org.camunda.bpm.model.cmmn.AssociationDirection; +import org.camunda.bpm.model.cmmn.instance.Artifact; +import org.camunda.bpm.model.cmmn.instance.Association; +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.reference.AttributeReference; + +/** + * @author Roman Smirnov + * + */ +public class AssociationImpl extends ArtifactImpl implements Association { + + protected static AttributeReference sourceRefAttribute; + protected static AttributeReference targetRefAttribute; + protected static Attribute associationDirectionAttribute; + + public AssociationImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public CmmnElement getSource() { + return sourceRefAttribute.getReferenceTargetElement(this); + } + + public void setSource(CmmnElement source) { + sourceRefAttribute.setReferenceTargetElement(this, source); + } + + public CmmnElement getTarget() { + return targetRefAttribute.getReferenceTargetElement(this); + } + + public void setTarget(CmmnElement target) { + targetRefAttribute.setReferenceTargetElement(this, target); + } + + public AssociationDirection getAssociationDirection() { + return associationDirectionAttribute.getValue(this); + } + + public void setAssociationDirection(AssociationDirection associationDirection) { + associationDirectionAttribute.setValue(this, associationDirection); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Association.class, CMMN_ELEMENT_ASSOCIATION) + .namespaceUri(CMMN11_NS) + .extendsType(Artifact.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public Association newInstance(ModelTypeInstanceContext instanceContext) { + return new AssociationImpl(instanceContext); + } + }); + + sourceRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_SOURCE_REF) + .idAttributeReference(CmmnElement.class) + .build(); + + targetRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_TARGET_REF) + .idAttributeReference(CmmnElement.class) + .build(); + + associationDirectionAttribute = typeBuilder.enumAttribute(CMMN_ATTRIBUTE_ASSOCIATION_DIRECTION, AssociationDirection.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/BindingRefinementExpressionImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/BindingRefinementExpressionImpl.java new file mode 100644 index 00000000000..202c85c9c34 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/BindingRefinementExpressionImpl.java @@ -0,0 +1,51 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_BINDING_REFINEMENT; + +import org.camunda.bpm.model.cmmn.instance.BindingRefinementExpression; +import org.camunda.bpm.model.cmmn.instance.Expression; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; + +/** + * @author Roman Smirnov + * + */ +public class BindingRefinementExpressionImpl extends ExpressionImpl implements BindingRefinementExpression { + + public BindingRefinementExpressionImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(BindingRefinementExpression.class, CMMN_ELEMENT_BINDING_REFINEMENT) + .namespaceUri(CMMN11_NS) + .extendsType(Expression.class) + .instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider() { + public BindingRefinementExpression newInstance(ModelTypeInstanceContext instanceContext) { + return new BindingRefinementExpressionImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/BodyImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/BodyImpl.java new file mode 100644 index 00000000000..07d7d44aca2 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/BodyImpl.java @@ -0,0 +1,53 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN10_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_BODY; + +import org.camunda.bpm.model.cmmn.instance.Body; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; + + +/** + * @author Roman Smirnov + * + */ +public class BodyImpl extends CmmnModelElementInstanceImpl implements Body { + + public BodyImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Body.class, CMMN_ELEMENT_BODY) + .namespaceUri(CMMN10_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public Body newInstance(ModelTypeInstanceContext instanceContext) { + return new BodyImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + + + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseFileImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseFileImpl.java new file mode 100644 index 00000000000..b0e320f51e0 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseFileImpl.java @@ -0,0 +1,68 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_CASE_FILE; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.CaseFile; +import org.camunda.bpm.model.cmmn.instance.CaseFileItem; +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.child.ChildElementCollection; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public class CaseFileImpl extends CmmnElementImpl implements CaseFile { + + protected static ChildElementCollection caseFileItemCollection; + + public CaseFileImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public Collection getCaseFileItems() { + return caseFileItemCollection.get(this); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CaseFile.class, CMMN_ELEMENT_CASE_FILE) + .namespaceUri(CMMN11_NS) + .extendsType(CmmnElement.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public CaseFile newInstance(ModelTypeInstanceContext instanceContext) { + return new CaseFileImpl(instanceContext); + } + }); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + caseFileItemCollection = sequenceBuilder.elementCollection(CaseFileItem.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseFileItemDefinitionImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseFileItemDefinitionImpl.java new file mode 100644 index 00000000000..a01d8e890f7 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseFileItemDefinitionImpl.java @@ -0,0 +1,128 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_DEFINITION_TYPE; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_NAME; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_STRUCTURE_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_CASE_FILE_ITEM_DEFINITION; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.CaseFileItemDefinition; +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.cmmn.instance.Property; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElementCollection; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public class CaseFileItemDefinitionImpl extends CmmnElementImpl implements CaseFileItemDefinition { + + protected static Attribute nameAttribute; + protected static Attribute definitionTypeAttribute; + // structureRef should be a QName, but it is not clear + // what kind of element the attribute value should reference, + // that's why we use a simple String + protected static Attribute structureAttribute; + + // TODO: The Import does not have an id attribute! +// protected static AttributeReference importRefAttribute; + protected static ChildElementCollection propertyCollection; + + public CaseFileItemDefinitionImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getName() { + return nameAttribute.getValue(this); + } + + public void setName(String name) { + nameAttribute.setValue(this, name); + } + + public String getDefinitionType() { + return definitionTypeAttribute.getValue(this); + } + + public void setDefinitionType(String definitionType) { + definitionTypeAttribute.setValue(this, definitionType); + } + + public String getStructure() { + return structureAttribute.getValue(this); + } + + public void setStructure(String structureRef) { + structureAttribute.setValue(this, structureRef); + } + +// public Import getImport() { +// return importRefAttribute.getReferenceTargetElement(this); +// } +// +// public void setImport(Import importRef) { +// importRefAttribute.setReferenceTargetElement(this, importRef); +// } + + public Collection getProperties() { + return propertyCollection.get(this); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CaseFileItemDefinition.class, CMMN_ELEMENT_CASE_FILE_ITEM_DEFINITION) + .namespaceUri(CMMN11_NS) + .extendsType(CmmnElement.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public CaseFileItemDefinition newInstance(ModelTypeInstanceContext instanceContext) { + return new CaseFileItemDefinitionImpl(instanceContext); + } + }); + + nameAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_NAME) + .build(); + + definitionTypeAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_DEFINITION_TYPE) + .defaultValue("http://www.omg.org/spec/CMMN/DefinitionType/Unspecified") + .build(); + + structureAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_STRUCTURE_REF) + .build(); + + // TODO: The Import does not have an id attribute! + // importRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_IMPORT_REF) + // .qNameAttributeReference(Import.class) + // .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + propertyCollection = sequenceBuilder.elementCollection(Property.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseFileItemImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseFileItemImpl.java new file mode 100644 index 00000000000..a39c9e9d586 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseFileItemImpl.java @@ -0,0 +1,162 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN10_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_DEFINITION_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_MULTIPLICITY; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_NAME; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_SOURCE_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_SOURCE_REFS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_TARGET_REFS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_CASE_FILE_ITEM; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.MultiplicityEnum; +import org.camunda.bpm.model.cmmn.instance.CaseFileItem; +import org.camunda.bpm.model.cmmn.instance.CaseFileItemDefinition; +import org.camunda.bpm.model.cmmn.instance.Children; +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; +import org.camunda.bpm.model.xml.type.reference.AttributeReference; +import org.camunda.bpm.model.xml.type.reference.AttributeReferenceCollection; + +/** + * @author Roman Smirnov + * + */ +public class CaseFileItemImpl extends CmmnElementImpl implements CaseFileItem { + + protected static Attribute nameAttribute; + protected static Attribute multiplicityAttribute; + protected static AttributeReference definitionRefAttribute; + protected static AttributeReferenceCollection targetRefCollection; + protected static ChildElement childrenChild; + + // cmmn 1.0 + @Deprecated + protected static AttributeReference sourceRefAttribute; + +// cmmn 1.1 + protected static AttributeReferenceCollection sourceRefCollection; + + + + public CaseFileItemImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getName() { + return nameAttribute.getValue(this); + } + + public void setName(String name) { + nameAttribute.setValue(this, name); + } + + public MultiplicityEnum getMultiplicity() { + return multiplicityAttribute.getValue(this); + } + + public void setMultiplicity(MultiplicityEnum multiplicity) { + multiplicityAttribute.setValue(this, multiplicity); + } + + public CaseFileItemDefinition getDefinitionRef() { + return definitionRefAttribute.getReferenceTargetElement(this); + } + + public void setDefinitionRef(CaseFileItemDefinition caseFileItemDefinition) { + definitionRefAttribute.setReferenceTargetElement(this, caseFileItemDefinition); + } + + public CaseFileItem getSourceRef() { + return sourceRefAttribute.getReferenceTargetElement(this); + } + + public void setSourceRef(CaseFileItem sourceRef) { + sourceRefAttribute.setReferenceTargetElement(this, sourceRef); + } + + public Collection getSourceRefs() { + return sourceRefCollection.getReferenceTargetElements(this); + } + + public Collection getTargetRefs() { + return targetRefCollection.getReferenceTargetElements(this); + } + + public Children getChildren() { + return childrenChild.getChild(this); + } + + public void setChildren(Children children) { + childrenChild.setChild(this, children); + } + + public static void registerType(ModelBuilder modelBuilder) { + + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CaseFileItem.class, CMMN_ELEMENT_CASE_FILE_ITEM) + .namespaceUri(CMMN11_NS) + .extendsType(CmmnElement.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public CaseFileItem newInstance(ModelTypeInstanceContext instanceContext) { + return new CaseFileItemImpl(instanceContext); + } + }); + + nameAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_NAME) + .build(); + + multiplicityAttribute = typeBuilder.enumAttribute(CMMN_ATTRIBUTE_MULTIPLICITY, MultiplicityEnum.class) + .defaultValue(MultiplicityEnum.Unspecified) + .build(); + + definitionRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_DEFINITION_REF) + .qNameAttributeReference(CaseFileItemDefinition.class) + .build(); + + sourceRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_SOURCE_REF) + .namespace(CMMN10_NS) + .idAttributeReference(CaseFileItem.class) + .build(); + + sourceRefCollection = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_SOURCE_REFS) + .idAttributeReferenceCollection(CaseFileItem.class, CmmnAttributeElementReferenceCollection.class) + .build(); + + targetRefCollection = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_TARGET_REFS) + .idAttributeReferenceCollection(CaseFileItem.class, CmmnAttributeElementReferenceCollection.class) + .build(); + + SequenceBuilder sequence = typeBuilder.sequence(); + + childrenChild = sequence.element(Children.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseFileItemOnPartImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseFileItemOnPartImpl.java new file mode 100644 index 00000000000..fa2fba3dab4 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseFileItemOnPartImpl.java @@ -0,0 +1,89 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_SOURCE_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_CASE_FILE_ITEM_ON_PART; + +import org.camunda.bpm.model.cmmn.CaseFileItemTransition; +import org.camunda.bpm.model.cmmn.instance.CaseFileItem; +import org.camunda.bpm.model.cmmn.instance.CaseFileItemOnPart; +import org.camunda.bpm.model.cmmn.instance.CaseFileItemTransitionStandardEvent; +import org.camunda.bpm.model.cmmn.instance.OnPart; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; +import org.camunda.bpm.model.xml.type.reference.AttributeReference; + +/** + * @author Roman Smirnov + * + */ +public class CaseFileItemOnPartImpl extends OnPartImpl implements CaseFileItemOnPart { + + protected static AttributeReference sourceRefAttribute; + protected static ChildElement standardEventChild; + + public CaseFileItemOnPartImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public CaseFileItem getSource() { + return sourceRefAttribute.getReferenceTargetElement(this); + } + + public void setSource(CaseFileItem source) { + sourceRefAttribute.setReferenceTargetElement(this, source); + } + + public CaseFileItemTransition getStandardEvent() { + CaseFileItemTransitionStandardEvent child = standardEventChild.getChild(this); + return child.getValue(); + } + + public void setStandardEvent(CaseFileItemTransition standardEvent) { + CaseFileItemTransitionStandardEvent child = standardEventChild.getChild(this); + child.setValue(standardEvent); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CaseFileItemOnPart.class, CMMN_ELEMENT_CASE_FILE_ITEM_ON_PART) + .extendsType(OnPart.class) + .namespaceUri(CMMN11_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public CaseFileItemOnPart newInstance(ModelTypeInstanceContext instanceContext) { + return new CaseFileItemOnPartImpl(instanceContext); + } + }); + + sourceRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_SOURCE_REF) + .idAttributeReference(CaseFileItem.class) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + standardEventChild = sequenceBuilder.element(CaseFileItemTransitionStandardEvent.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseFileItemStartTriggerImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseFileItemStartTriggerImpl.java new file mode 100644 index 00000000000..95454e6accb --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseFileItemStartTriggerImpl.java @@ -0,0 +1,89 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_SOURCE_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_CASE_FILE_ITEM_START_TRIGGER; + +import org.camunda.bpm.model.cmmn.CaseFileItemTransition; +import org.camunda.bpm.model.cmmn.instance.CaseFileItem; +import org.camunda.bpm.model.cmmn.instance.CaseFileItemStartTrigger; +import org.camunda.bpm.model.cmmn.instance.CaseFileItemTransitionStandardEvent; +import org.camunda.bpm.model.cmmn.instance.StartTrigger; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; +import org.camunda.bpm.model.xml.type.reference.AttributeReference; + +/** + * @author Roman Smirnov + * + */ +public class CaseFileItemStartTriggerImpl extends StartTriggerImpl implements CaseFileItemStartTrigger { + + protected static AttributeReference sourceRefAttribute; + protected static ChildElement standardEventChild; + + public CaseFileItemStartTriggerImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public CaseFileItem getSource() { + return sourceRefAttribute.getReferenceTargetElement(this); + } + + public void setSource(CaseFileItem source) { + sourceRefAttribute.setReferenceTargetElement(this, source); + } + + public CaseFileItemTransition getStandardEvent() { + CaseFileItemTransitionStandardEvent child = standardEventChild.getChild(this); + return child.getValue(); + } + + public void setStandardEvent(CaseFileItemTransition standardEvent) { + CaseFileItemTransitionStandardEvent child = standardEventChild.getChild(this); + child.setValue(standardEvent); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CaseFileItemStartTrigger.class, CMMN_ELEMENT_CASE_FILE_ITEM_START_TRIGGER) + .extendsType(StartTrigger.class) + .namespaceUri(CMMN11_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public CaseFileItemStartTrigger newInstance(ModelTypeInstanceContext instanceContext) { + return new CaseFileItemStartTriggerImpl(instanceContext); + } + }); + + sourceRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_SOURCE_REF) + .idAttributeReference(CaseFileItem.class) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + standardEventChild = sequenceBuilder.element(CaseFileItemTransitionStandardEvent.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseFileItemTransitionStandardEventImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseFileItemTransitionStandardEventImpl.java new file mode 100644 index 00000000000..2e7d372ecaa --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseFileItemTransitionStandardEventImpl.java @@ -0,0 +1,59 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_STANDARD_EVENT; + +import org.camunda.bpm.model.cmmn.CaseFileItemTransition; +import org.camunda.bpm.model.cmmn.instance.CaseFileItemTransitionStandardEvent; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; + +/** + * @author Roman Smirnov + * + */ +public class CaseFileItemTransitionStandardEventImpl extends CmmnModelElementInstanceImpl implements CaseFileItemTransitionStandardEvent { + + public CaseFileItemTransitionStandardEventImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CaseFileItemTransitionStandardEvent.class, CMMN_ELEMENT_STANDARD_EVENT) + .namespaceUri(CMMN11_NS) + .instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider() { + public CaseFileItemTransitionStandardEvent newInstance(ModelTypeInstanceContext instanceContext) { + return new CaseFileItemTransitionStandardEventImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + + public CaseFileItemTransition getValue() { + String standardEvent = getTextContent().trim(); + return Enum.valueOf(CaseFileItemTransition.class, standardEvent); + } + + public void setValue(CaseFileItemTransition value) { + setTextContent(value.toString()); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseFileModelImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseFileModelImpl.java new file mode 100644 index 00000000000..71f1bef094f --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseFileModelImpl.java @@ -0,0 +1,51 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_CASE_FILE_MODEL; + +import org.camunda.bpm.model.cmmn.instance.CaseFile; +import org.camunda.bpm.model.cmmn.instance.CaseFileModel; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; + +/** + * @author Roman Smirnov + * + */ +public class CaseFileModelImpl extends CaseFileImpl implements CaseFileModel { + + public CaseFileModelImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CaseFileModel.class, CMMN_ELEMENT_CASE_FILE_MODEL) + .namespaceUri(CMMN11_NS) + .extendsType(CaseFile.class) + .instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider() { + public CaseFileModel newInstance(ModelTypeInstanceContext instanceContext) { + return new CaseFileModelImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseImpl.java new file mode 100644 index 00000000000..c5c3968f034 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseImpl.java @@ -0,0 +1,171 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.*; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.Case; +import org.camunda.bpm.model.cmmn.instance.CaseFileModel; +import org.camunda.bpm.model.cmmn.instance.CasePlanModel; +import org.camunda.bpm.model.cmmn.instance.CaseRoles; +import org.camunda.bpm.model.cmmn.instance.CaseRole; +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.cmmn.instance.InputCaseParameter; +import org.camunda.bpm.model.cmmn.instance.OutputCaseParameter; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.ChildElementCollection; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public class CaseImpl extends CmmnElementImpl implements Case { + + protected static Attribute nameAttribute; + protected static Attribute camundaHistoryTimeToLive; + + protected static ChildElement caseFileModelChild; + protected static ChildElement casePlanModelChild; + protected static ChildElementCollection inputCollection; + protected static ChildElementCollection outputCollection; + + // cmmn 1.0 + @Deprecated + protected static ChildElementCollection caseRolesCollection; + + // cmmn 1.1 + protected static ChildElement caseRolesChild; + + public CaseImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getName() { + return nameAttribute.getValue(this); + } + + public void setName(String name) { + nameAttribute.setValue(this, name); + } + + public Collection getCaseRoles() { + return caseRolesCollection.get(this); + } + + public CaseRoles getRoles() { + return caseRolesChild.getChild(this); + } + + public void setRoles(CaseRoles caseRole) { + caseRolesChild.setChild(this, caseRole); + } + + public Collection getInputs() { + return inputCollection.get(this); + } + + public Collection getOutputs() { + return outputCollection.get(this); + } + + public CasePlanModel getCasePlanModel() { + return casePlanModelChild.getChild(this); + } + + public void setCasePlanModel(CasePlanModel casePlanModel) { + casePlanModelChild.setChild(this, casePlanModel); + } + + public CaseFileModel getCaseFileModel() { + return caseFileModelChild.getChild(this); + } + + public void setCaseFileModel(CaseFileModel caseFileModel) { + caseFileModelChild.setChild(this, caseFileModel); + } + + public Integer getCamundaHistoryTimeToLive() { + String ttl = getCamundaHistoryTimeToLiveString(); + if (ttl != null) { + return Integer.parseInt(ttl); + } + return null; + } + + public void setCamundaHistoryTimeToLive(Integer historyTimeToLive) { + setCamundaHistoryTimeToLiveString(String.valueOf(historyTimeToLive)); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Case.class, CMMN_ELEMENT_CASE) + .extendsType(CmmnElement.class) + .namespaceUri(CMMN11_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public Case newInstance(ModelTypeInstanceContext instanceContext) { + return new CaseImpl(instanceContext); + } + }); + + nameAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_NAME) + .build(); + + camundaHistoryTimeToLive = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_HISTORY_TIME_TO_LIVE) + .namespace(CAMUNDA_NS) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + caseFileModelChild = sequenceBuilder.element(CaseFileModel.class) + .build(); + + casePlanModelChild = sequenceBuilder.element(CasePlanModel.class) + .build(); + + caseRolesCollection = sequenceBuilder.elementCollection(CaseRole.class) + .build(); + + caseRolesChild = sequenceBuilder.element(CaseRoles.class) + .build(); + + inputCollection = sequenceBuilder.elementCollection(InputCaseParameter.class) + .build(); + + outputCollection = sequenceBuilder.elementCollection(OutputCaseParameter.class) + .build(); + + typeBuilder.build(); + } + + @Override + public String getCamundaHistoryTimeToLiveString() { + return camundaHistoryTimeToLive.getValue(this); + } + + @Override + public void setCamundaHistoryTimeToLiveString(String historyTimeToLive) { + camundaHistoryTimeToLive.setValue(this, historyTimeToLive); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseParameterImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseParameterImpl.java new file mode 100644 index 00000000000..69bc8867216 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseParameterImpl.java @@ -0,0 +1,87 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_BINDING_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_CASE_PARAMETER; + +import org.camunda.bpm.model.cmmn.instance.BindingRefinementExpression; +import org.camunda.bpm.model.cmmn.instance.CaseFileItem; +import org.camunda.bpm.model.cmmn.instance.CaseParameter; +import org.camunda.bpm.model.cmmn.instance.Parameter; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; +import org.camunda.bpm.model.xml.type.reference.AttributeReference; + +/** + * @author Roman Smirnov + * + */ +public class CaseParameterImpl extends ParameterImpl implements CaseParameter { + + protected static AttributeReference bindingRefAttribute; + protected static ChildElement bindingRefinementChild; + + public CaseParameterImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public CaseFileItem getBinding() { + return bindingRefAttribute.getReferenceTargetElement(this); + } + + public void setBinding(CaseFileItem bindingRef) { + bindingRefAttribute.setReferenceTargetElement(this, bindingRef); + } + + public BindingRefinementExpression getBindingRefinement() { + return bindingRefinementChild.getChild(this); + } + + public void setBindingRefinement(BindingRefinementExpression bindingRefinement) { + bindingRefinementChild.setChild(this, bindingRefinement); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CaseParameter.class, CMMN_ELEMENT_CASE_PARAMETER) + .namespaceUri(CMMN11_NS) + .extendsType(Parameter.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public CaseParameter newInstance(ModelTypeInstanceContext instanceContext) { + return new CaseParameterImpl(instanceContext); + } + }); + + bindingRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_BINDING_REF) + .idAttributeReference(CaseFileItem.class) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + bindingRefinementChild = sequenceBuilder.element(BindingRefinementExpression.class) + .build(); + + typeBuilder.build(); + } + + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CasePlanModel.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CasePlanModel.java new file mode 100644 index 00000000000..6dbf73752cd --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CasePlanModel.java @@ -0,0 +1,50 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_CASE_PLAN_MODEL; + +import org.camunda.bpm.model.cmmn.instance.Stage; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; + +/** + * @author Roman Smirnov + * + */ +public class CasePlanModel extends StageImpl implements org.camunda.bpm.model.cmmn.instance.CasePlanModel { + + public CasePlanModel(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(org.camunda.bpm.model.cmmn.instance.CasePlanModel.class, CMMN_ELEMENT_CASE_PLAN_MODEL) + .namespaceUri(CMMN11_NS) + .extendsType(Stage.class) + .instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider() { + public CasePlanModel newInstance(ModelTypeInstanceContext instanceContext) { + return new CasePlanModel(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseRefExpressionImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseRefExpressionImpl.java new file mode 100644 index 00000000000..50f4b9bc32c --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseRefExpressionImpl.java @@ -0,0 +1,51 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_CASE_REF_EXPRESSION; + +import org.camunda.bpm.model.cmmn.instance.CaseRefExpression; +import org.camunda.bpm.model.cmmn.instance.Expression; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; + +/** + * @author Roman Smirnov + * + */ +public class CaseRefExpressionImpl extends ExpressionImpl implements CaseRefExpression { + + public CaseRefExpressionImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CaseRefExpression.class, CMMN_ELEMENT_CASE_REF_EXPRESSION) + .namespaceUri(CMMN11_NS) + .extendsType(Expression.class) + .instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider() { + public CaseRefExpression newInstance(ModelTypeInstanceContext instanceContext) { + return new CaseRefExpressionImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseRoleImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseRoleImpl.java new file mode 100644 index 00000000000..027758ca6dc --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseRoleImpl.java @@ -0,0 +1,51 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN10_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_CASE_ROLES; + +import org.camunda.bpm.model.cmmn.instance.CaseRole; +import org.camunda.bpm.model.cmmn.instance.Role; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; + +/** + * @author Roman Smirnov + * + */ +public class CaseRoleImpl extends RoleImpl implements CaseRole { + + public CaseRoleImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CaseRole.class, CMMN_ELEMENT_CASE_ROLES) + .namespaceUri(CMMN10_NS) + .extendsType(Role.class) + .instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider() { + public CaseRole newInstance(ModelTypeInstanceContext instanceContext) { + return new CaseRoleImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseRolesImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseRolesImpl.java new file mode 100644 index 00000000000..6a17c82e1c4 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseRolesImpl.java @@ -0,0 +1,64 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_CASE_ROLES; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.CaseRoles; +import org.camunda.bpm.model.cmmn.instance.Role; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.child.ChildElementCollection; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public class CaseRolesImpl extends CmmnElementImpl implements CaseRoles { + + protected static ChildElementCollection roleCollection; + + public CaseRolesImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public Collection getRoles() { + return roleCollection.get(this); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CaseRoles.class, CMMN_ELEMENT_CASE_ROLES) + .namespaceUri(CMMN11_NS) + .instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider() { + public CaseRoles newInstance(ModelTypeInstanceContext instanceContext) { + return new CaseRolesImpl(instanceContext); + } + }); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + roleCollection = sequenceBuilder.elementCollection(Role.class) + .build(); + + typeBuilder.build(); + } +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseTaskImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseTaskImpl.java new file mode 100644 index 00000000000..6f43519a30a --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CaseTaskImpl.java @@ -0,0 +1,144 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_CASE_BINDING; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_CASE_VERSION; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_CASE_TENANT_ID; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_CASE_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_CASE_TASK; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.CaseRefExpression; +import org.camunda.bpm.model.cmmn.instance.CaseTask; +import org.camunda.bpm.model.cmmn.instance.ParameterMapping; +import org.camunda.bpm.model.cmmn.instance.Task; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.ChildElementCollection; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public class CaseTaskImpl extends TaskImpl implements CaseTask { + + protected static Attribute caseRefAttribute; + protected static ChildElementCollection parameterMappingCollection; + + // cmmn 1.1 + protected static ChildElement caseRefExpressionChild; + + protected static Attribute camundaCaseBindingAttribute; + protected static Attribute camundaCaseVersionAttribute; + protected static Attribute camundaCaseTenantIdAttribute; + + public CaseTaskImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getCase() { + return caseRefAttribute.getValue(this); + } + + public void setCase(String caseInstance) { + caseRefAttribute.setValue(this, caseInstance); + } + + public CaseRefExpression getCaseExpression() { + return caseRefExpressionChild.getChild(this); + } + + public void setCaseExpression(CaseRefExpression caseExpression) { + caseRefExpressionChild.setChild(this, caseExpression); + } + + public Collection getParameterMappings() { + return parameterMappingCollection.get(this); + } + + public String getCamundaCaseBinding() { + return camundaCaseBindingAttribute.getValue(this); + } + + public void setCamundaCaseBinding(String camundaCaseBinding) { + camundaCaseBindingAttribute.setValue(this, camundaCaseBinding); + } + + public String getCamundaCaseVersion() { + return camundaCaseVersionAttribute.getValue(this); + } + + public void setCamundaCaseVersion(String camundaCaseVersion) { + camundaCaseVersionAttribute.setValue(this, camundaCaseVersion); + } + + public String getCamundaCaseTenantId() { + return camundaCaseTenantIdAttribute.getValue(this); + } + + public void setCamundaCaseTenantId(String camundaCaseTenantId) { + camundaCaseTenantIdAttribute.setValue(this, camundaCaseTenantId); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CaseTask.class, CMMN_ELEMENT_CASE_TASK) + .extendsType(Task.class) + .namespaceUri(CMMN11_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public CaseTask newInstance(ModelTypeInstanceContext instanceContext) { + return new CaseTaskImpl(instanceContext); + } + }); + + caseRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_CASE_REF) + .build(); + + /** camunda extensions */ + + camundaCaseBindingAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_CASE_BINDING) + .namespace(CAMUNDA_NS) + .build(); + + camundaCaseVersionAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_CASE_VERSION) + .namespace(CAMUNDA_NS) + .build(); + + camundaCaseTenantIdAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_CASE_TENANT_ID) + .namespace(CAMUNDA_NS) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + parameterMappingCollection = sequenceBuilder.elementCollection(ParameterMapping.class) + .build(); + + caseRefExpressionChild = sequenceBuilder.element(CaseRefExpression.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ChildrenImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ChildrenImpl.java new file mode 100644 index 00000000000..8a6154ea0e8 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ChildrenImpl.java @@ -0,0 +1,68 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_CHILDREN; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.CaseFileItem; +import org.camunda.bpm.model.cmmn.instance.Children; +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.child.ChildElementCollection; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public class ChildrenImpl extends CmmnElementImpl implements Children { + + protected static ChildElementCollection caseFileItemCollection; + + public ChildrenImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public Collection getCaseFileItems() { + return caseFileItemCollection.get(this); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Children.class, CMMN_ELEMENT_CHILDREN) + .namespaceUri(CMMN11_NS) + .extendsType(CmmnElement.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public Children newInstance(ModelTypeInstanceContext instanceContext) { + return new ChildrenImpl(instanceContext); + } + }); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + caseFileItemCollection = sequenceBuilder.elementCollection(CaseFileItem.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CmmnAttributeElementReferenceCollection.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CmmnAttributeElementReferenceCollection.java new file mode 100644 index 00000000000..82a6bb7581e --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CmmnAttributeElementReferenceCollection.java @@ -0,0 +1,38 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.xml.impl.type.attribute.AttributeImpl; +import org.camunda.bpm.model.xml.type.reference.AttributeReferenceCollection; + +/** + * @author Roman Smirnov + * + */ +public class CmmnAttributeElementReferenceCollection extends AttributeReferenceCollection { + + public CmmnAttributeElementReferenceCollection(AttributeImpl referenceSourceAttribute) { + super(referenceSourceAttribute); + } + + protected String getTargetElementIdentifier(CmmnElement referenceTargetElement) { + return referenceTargetElement.getId(); + } + + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CmmnElementImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CmmnElementImpl.java new file mode 100644 index 00000000000..45681cd6f9e --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CmmnElementImpl.java @@ -0,0 +1,115 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN10_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_DESCRIPTION; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_ID; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.impl.CmmnModelConstants; +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.cmmn.instance.Documentation; +import org.camunda.bpm.model.cmmn.instance.ExtensionElements; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.ChildElementCollection; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public abstract class CmmnElementImpl extends CmmnModelElementInstanceImpl implements CmmnElement { + + protected static Attribute idAttribute; + protected static ChildElement extensionElementsChild; + + // cmmn 1.0 + @Deprecated + protected static Attribute descriptionAttribute; + + // cmmn 1.1 + protected static ChildElementCollection documentationCollection; + + public CmmnElementImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getId() { + return idAttribute.getValue(this); + } + + public void setId(String id) { + idAttribute.setValue(this, id); + } + + public String getDescription() { + return descriptionAttribute.getValue(this); + } + + public void setDescription(String description) { + descriptionAttribute.setValue(this, description); + } + + public Collection getDocumentations() { + return documentationCollection.get(this); + } + + public ExtensionElements getExtensionElements() { + return extensionElementsChild.getChild(this); + } + + public void setExtensionElements(ExtensionElements extensionElements) { + extensionElementsChild.setChild(this, extensionElements); + } + + protected boolean isCmmn11() { + return CmmnModelConstants.CMMN11_NS.equals(getDomElement().getNamespaceURI()); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CmmnElement.class, CMMN_ELEMENT) + .abstractType() + .namespaceUri(CMMN11_NS); + + idAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_ID) + .idAttribute() + .build(); + + descriptionAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_DESCRIPTION) + .namespace(CMMN10_NS) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + documentationCollection = sequenceBuilder.elementCollection(Documentation.class) + .build(); + + extensionElementsChild = sequenceBuilder.element(ExtensionElements.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CmmnModelElementInstanceImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CmmnModelElementInstanceImpl.java new file mode 100644 index 00000000000..ac2d57d1d90 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CmmnModelElementInstanceImpl.java @@ -0,0 +1,33 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstance; +import org.camunda.bpm.model.xml.impl.instance.ModelElementInstanceImpl; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; + +/** + * @author Roman Smirnov + * + */ +public abstract class CmmnModelElementInstanceImpl extends ModelElementInstanceImpl implements CmmnModelElementInstance { + + public CmmnModelElementInstanceImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ConditionExpressionImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ConditionExpressionImpl.java new file mode 100644 index 00000000000..82f30ac3dbb --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ConditionExpressionImpl.java @@ -0,0 +1,51 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_CONDITION; + +import org.camunda.bpm.model.cmmn.instance.ConditionExpression; +import org.camunda.bpm.model.cmmn.instance.Expression; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; + +/** + * @author Roman Smirnov + * + */ +public class ConditionExpressionImpl extends ExpressionImpl implements ConditionExpression { + + public ConditionExpressionImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(ConditionExpression.class, CMMN_ELEMENT_CONDITION) + .namespaceUri(CMMN11_NS) + .extendsType(Expression.class) + .instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider() { + public ConditionExpression newInstance(ModelTypeInstanceContext instanceContext) { + return new ConditionExpressionImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CriterionImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CriterionImpl.java new file mode 100644 index 00000000000..dd30faea796 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/CriterionImpl.java @@ -0,0 +1,78 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_NAME; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_SENTRY_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_CRITERION; + +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.cmmn.instance.Criterion; +import org.camunda.bpm.model.cmmn.instance.Sentry; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.reference.AttributeReference; + +/** + * @author Roman Smirnov + * + */ +public abstract class CriterionImpl extends CmmnElementImpl implements Criterion { + + protected static Attribute nameAttribute; + protected static AttributeReference sentryRefAttribute; + + public CriterionImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getName() { + return nameAttribute.getValue(this); + } + + public void setName(String name) { + nameAttribute.setValue(this, name); + } + + public Sentry getSentry() { + return sentryRefAttribute.getReferenceTargetElement(this); + } + + public void setSentry(Sentry sentry) { + sentryRefAttribute.setReferenceTargetElement(this, sentry); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Criterion.class, CMMN_ELEMENT_CRITERION) + .extendsType(CmmnElement.class) + .namespaceUri(CMMN11_NS) + .abstractType(); + + nameAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_NAME) + .build(); + + sentryRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_SENTRY_REF) + .idAttributeReference(Sentry.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/DecisionImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/DecisionImpl.java new file mode 100644 index 00000000000..1372ae90180 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/DecisionImpl.java @@ -0,0 +1,106 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_IMPLEMENTATION_TYPE; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_NAME; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_DECISION; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.cmmn.instance.Decision; +import org.camunda.bpm.model.cmmn.instance.InputDecisionParameter; +import org.camunda.bpm.model.cmmn.instance.OutputDecisionParameter; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElementCollection; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public class DecisionImpl extends CmmnElementImpl implements Decision { + + protected static Attribute nameAttribute; + protected static Attribute implementationTypeAttribute; + + protected static ChildElementCollection inputCollection; + protected static ChildElementCollection outputCollection; + + public DecisionImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getName() { + return nameAttribute.getValue(this); + } + + public void setName(String name) { + nameAttribute.setValue(this, name); + } + + public String getImplementationType() { + return implementationTypeAttribute.getValue(this); + } + + public void setImplementationType(String implementationType) { + implementationTypeAttribute.setValue(this, implementationType); + } + + public Collection getInputs() { + return inputCollection.get(this); + } + + public Collection getOutputs() { + return outputCollection.get(this); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Decision.class, CMMN_ELEMENT_DECISION) + .extendsType(CmmnElement.class) + .namespaceUri(CMMN11_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public Decision newInstance(ModelTypeInstanceContext instanceContext) { + return new DecisionImpl(instanceContext); + } + }); + + nameAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_NAME) + .build(); + + implementationTypeAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_IMPLEMENTATION_TYPE) + .defaultValue("http://www.omg.org/spec/CMMN/DecisionType/Unspecified") + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + inputCollection = sequenceBuilder.elementCollection(InputDecisionParameter.class) + .build(); + + outputCollection = sequenceBuilder.elementCollection(OutputDecisionParameter.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/DecisionParameterImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/DecisionParameterImpl.java new file mode 100644 index 00000000000..4ff393c17c0 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/DecisionParameterImpl.java @@ -0,0 +1,52 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_DECISION_PARAMETER; + +import org.camunda.bpm.model.cmmn.instance.DecisionParameter; +import org.camunda.bpm.model.cmmn.instance.Parameter; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; + +/** + * @author Roman Smirnov + * + */ +public class DecisionParameterImpl extends ParameterImpl implements DecisionParameter { + + public DecisionParameterImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(DecisionParameter.class, CMMN_ELEMENT_DECISION_PARAMETER) + .namespaceUri(CMMN11_NS) + .extendsType(Parameter.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public DecisionParameter newInstance(ModelTypeInstanceContext instanceContext) { + return new DecisionParameterImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/DecisionRefExpressionImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/DecisionRefExpressionImpl.java new file mode 100644 index 00000000000..c21f3449d17 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/DecisionRefExpressionImpl.java @@ -0,0 +1,51 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_DECISION_REF_EXPRESSION; + +import org.camunda.bpm.model.cmmn.instance.DecisionRefExpression; +import org.camunda.bpm.model.cmmn.instance.Expression; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; + +/** + * @author Roman Smirnov + * + */ +public class DecisionRefExpressionImpl extends ExpressionImpl implements DecisionRefExpression { + + public DecisionRefExpressionImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(DecisionRefExpression.class, CMMN_ELEMENT_DECISION_REF_EXPRESSION) + .namespaceUri(CMMN11_NS) + .extendsType(Expression.class) + .instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider() { + public DecisionRefExpression newInstance(ModelTypeInstanceContext instanceContext) { + return new DecisionRefExpressionImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/DecisionTaskImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/DecisionTaskImpl.java new file mode 100644 index 00000000000..3b9579bd5ec --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/DecisionTaskImpl.java @@ -0,0 +1,174 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_DECISION_BINDING; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_DECISION_VERSION; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_DECISION_TENANT_ID; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_MAP_DECISION_RESULT; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_RESULT_VARIABLE; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_DECISION_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_DECISION_TASK; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.DecisionRefExpression; +import org.camunda.bpm.model.cmmn.instance.DecisionTask; +import org.camunda.bpm.model.cmmn.instance.ParameterMapping; +import org.camunda.bpm.model.cmmn.instance.Task; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.ChildElementCollection; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public class DecisionTaskImpl extends TaskImpl implements DecisionTask { + + protected static Attribute decisionRefAttribute; + + protected static ChildElementCollection parameterMappingCollection; + protected static ChildElement decisionRefExpressionChild; + + /** Camunda extensions */ + protected static Attribute camundaResultVariableAttribute; + protected static Attribute camundaDecisionBindingAttribute; + protected static Attribute camundaDecisionVersionAttribute; + protected static Attribute camundaDecisionTenantIdAttribute; + protected static Attribute camundaMapDecisionResultAttribute; + + public DecisionTaskImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getDecision() { + return decisionRefAttribute.getValue(this); + } + + public void setDecision(String decision) { + decisionRefAttribute.setValue(this, decision); + } + + public Collection getParameterMappings() { + return parameterMappingCollection.get(this); + } + + public DecisionRefExpression getDecisionExpression() { + return decisionRefExpressionChild.getChild(this); + } + + public void setDecisionExpression(DecisionRefExpression decisionExpression) { + decisionRefExpressionChild.setChild(this, decisionExpression); + } + + public String getCamundaResultVariable() { + return camundaResultVariableAttribute.getValue(this); + } + + public void setCamundaResultVariable(String camundaResultVariable) { + camundaResultVariableAttribute.setValue(this, camundaResultVariable); + } + + public String getCamundaDecisionBinding() { + return camundaDecisionBindingAttribute.getValue(this); + } + + public void setCamundaDecisionBinding(String camundaDecisionBinding) { + camundaDecisionBindingAttribute.setValue(this, camundaDecisionBinding); + } + + public String getCamundaDecisionVersion() { + return camundaDecisionVersionAttribute.getValue(this); + } + + public void setCamundaDecisionVersion(String camundaDecisionVersion) { + camundaDecisionVersionAttribute.setValue(this, camundaDecisionVersion); + } + + public String getCamundaDecisionTenantId() { + return camundaDecisionTenantIdAttribute.getValue(this); + } + + public void setCamundaDecisionTenantId(String camundaDecisionTenantId) { + camundaDecisionTenantIdAttribute.setValue(this, camundaDecisionTenantId); + } + + @Override + public String getCamundaMapDecisionResult() { + return camundaMapDecisionResultAttribute.getValue(this); + } + + @Override + public void setCamundaMapDecisionResult(String camundaMapDecisionResult) { + camundaMapDecisionResultAttribute.setValue(this, camundaMapDecisionResult); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(DecisionTask.class, CMMN_ELEMENT_DECISION_TASK) + .namespaceUri(CMMN11_NS) + .extendsType(Task.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public DecisionTask newInstance(ModelTypeInstanceContext instanceContext) { + return new DecisionTaskImpl(instanceContext); + } + }); + + decisionRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_DECISION_REF) + .build(); + + /** Camunda extensions */ + + camundaResultVariableAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_RESULT_VARIABLE) + .namespace(CAMUNDA_NS) + .build(); + + camundaDecisionBindingAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_DECISION_BINDING) + .namespace(CAMUNDA_NS) + .build(); + + camundaDecisionVersionAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_DECISION_VERSION) + .namespace(CAMUNDA_NS) + .build(); + + camundaDecisionTenantIdAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_DECISION_TENANT_ID) + .namespace(CAMUNDA_NS) + .build(); + + camundaMapDecisionResultAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_MAP_DECISION_RESULT) + .namespace(CAMUNDA_NS) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + parameterMappingCollection = sequenceBuilder.elementCollection(ParameterMapping.class) + .build(); + + decisionRefExpressionChild = sequenceBuilder.element(DecisionRefExpression.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/DefaultControlImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/DefaultControlImpl.java new file mode 100644 index 00000000000..30dd00f7cde --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/DefaultControlImpl.java @@ -0,0 +1,52 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_DEFAULT_CONTROL; + +import org.camunda.bpm.model.cmmn.instance.DefaultControl; +import org.camunda.bpm.model.cmmn.instance.PlanItemControl; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; + +/** + * @author Roman Smirnov + * + */ +public class DefaultControlImpl extends PlanItemControlImpl implements DefaultControl { + + public DefaultControlImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(DefaultControl.class, CMMN_ELEMENT_DEFAULT_CONTROL) + .namespaceUri(CMMN11_NS) + .extendsType(PlanItemControl.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public DefaultControl newInstance(ModelTypeInstanceContext instanceContext) { + return new DefaultControlImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/DefinitionsImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/DefinitionsImpl.java new file mode 100644 index 00000000000..a4f09a2e693 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/DefinitionsImpl.java @@ -0,0 +1,235 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_AUTHOR; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_EXPORTER; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_EXPORTER_VERSION; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_EXPRESSION_LANGUAGE; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_ID; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_NAME; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_TARGET_NAMESPACE; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_DEFINITIONS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.XPATH_NS; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.Artifact; +import org.camunda.bpm.model.cmmn.instance.Case; +import org.camunda.bpm.model.cmmn.instance.CaseFileItemDefinition; +import org.camunda.bpm.model.cmmn.instance.Decision; +import org.camunda.bpm.model.cmmn.instance.Definitions; +import org.camunda.bpm.model.cmmn.instance.ExtensionElements; +import org.camunda.bpm.model.cmmn.instance.Import; +import org.camunda.bpm.model.cmmn.instance.Process; +import org.camunda.bpm.model.cmmn.instance.Relationship; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.ChildElementCollection; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public class DefinitionsImpl extends CmmnModelElementInstanceImpl implements Definitions { + + protected static Attribute idAttribute; + protected static Attribute nameAttribute; + protected static Attribute targetNamespaceAttribute; + protected static Attribute expressionLanguageAttribute; + protected static Attribute exporterAttribute; + protected static Attribute exporterVersionAttribute; + protected static Attribute authorAttribute; + + protected static ChildElementCollection importCollection; + protected static ChildElementCollection caseFileItemDefinitionCollection; + protected static ChildElementCollection caseCollection; + protected static ChildElementCollection processCollection; + protected static ChildElementCollection relationshipCollection; + + // cmmn 1.1 + protected static ChildElement extensionElementsChild; + protected static ChildElementCollection decisionCollection; + protected static ChildElementCollection artifactCollection; + + public DefinitionsImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getId() { + return idAttribute.getValue(this); + } + + public void setId(String id) { + idAttribute.setValue(this, id); + } + + public String getName() { + return nameAttribute.getValue(this); + } + + public void setName(String name) { + nameAttribute.setValue(this, name); + } + + public String getTargetNamespace() { + return targetNamespaceAttribute.getValue(this); + } + + public void setTargetNamespace(String namespace) { + targetNamespaceAttribute.setValue(this, namespace); + } + + public String getExpressionLanguage() { + return expressionLanguageAttribute.getValue(this); + } + + public void setExpressionLanguage(String expressionLanguage) { + expressionLanguageAttribute.setValue(this, expressionLanguage); + } + + public String getExporter() { + return exporterAttribute.getValue(this); + } + + public void setExporter(String exporter) { + exporterAttribute.setValue(this, exporter); + } + + public String getExporterVersion() { + return exporterVersionAttribute.getValue(this); + } + + public void setExporterVersion(String exporterVersion) { + exporterVersionAttribute.setValue(this, exporterVersion); + } + + public String getAuthor() { + return authorAttribute.getValue(this); + } + + public void setAuthor(String author) { + authorAttribute.setValue(this, author); + } + + public Collection getImports() { + return importCollection.get(this); + } + + public Collection getCaseFileItemDefinitions() { + return caseFileItemDefinitionCollection.get(this); + } + + public Collection getCases() { + return caseCollection.get(this); + } + + public Collection getProcesses() { + return processCollection.get(this); + } + + public Collection getDecisions() { + return decisionCollection.get(this); + } + + public ExtensionElements getExtensionElements() { + return extensionElementsChild.getChild(this); + } + + public void setExtensionElements(ExtensionElements extensionElements) { + extensionElementsChild.setChild(this, extensionElements); + } + + public Collection getRelationships() { + return relationshipCollection.get(this); + } + + public Collection getArtifacts() { + return artifactCollection.get(this); + } + + public static void registerType(ModelBuilder modelBuilder) { + + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Definitions.class, CMMN_ELEMENT_DEFINITIONS) + .namespaceUri(CMMN11_NS) + .instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider() { + public Definitions newInstance(ModelTypeInstanceContext instanceContext) { + return new DefinitionsImpl(instanceContext); + } + }); + + idAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_ID) + .idAttribute() + .build(); + + nameAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_NAME) + .build(); + + targetNamespaceAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_TARGET_NAMESPACE) + .required() + .build(); + + expressionLanguageAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_EXPRESSION_LANGUAGE) + .defaultValue(XPATH_NS) + .build(); + + exporterAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_EXPORTER) + .build(); + + exporterVersionAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_EXPORTER_VERSION) + .build(); + + authorAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_AUTHOR) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + importCollection = sequenceBuilder.elementCollection(Import.class) + .build(); + + caseFileItemDefinitionCollection = sequenceBuilder.elementCollection(CaseFileItemDefinition.class) + .build(); + + caseCollection = sequenceBuilder.elementCollection(Case.class) + .build(); + + processCollection = sequenceBuilder.elementCollection(Process.class) + .build(); + + decisionCollection = sequenceBuilder.elementCollection(Decision.class) + .build(); + + extensionElementsChild = sequenceBuilder.element(ExtensionElements.class) + .minOccurs(0) + .maxOccurs(1) + .build(); + + relationshipCollection = sequenceBuilder.elementCollection(Relationship.class) + .build(); + + artifactCollection = sequenceBuilder.elementCollection(Artifact.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/DiscretionaryItemImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/DiscretionaryItemImpl.java new file mode 100644 index 00000000000..a04315c53eb --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/DiscretionaryItemImpl.java @@ -0,0 +1,123 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_DEFINITION_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_NAME; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_DISCRETIONARY_ITEM; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.DiscretionaryItem; +import org.camunda.bpm.model.cmmn.instance.EntryCriterion; +import org.camunda.bpm.model.cmmn.instance.ExitCriterion; +import org.camunda.bpm.model.cmmn.instance.ItemControl; +import org.camunda.bpm.model.cmmn.instance.PlanItemDefinition; +import org.camunda.bpm.model.cmmn.instance.TableItem; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.ChildElementCollection; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; +import org.camunda.bpm.model.xml.type.reference.AttributeReference; + +/** + * @author Roman Smirnov + * + */ +public class DiscretionaryItemImpl extends TableItemImpl implements DiscretionaryItem { + + protected static AttributeReference definitionRefAttribute; + protected static ChildElement itemControlChild; + + // cmmn 1.1 + protected static Attribute nameAttribute; + protected static ChildElementCollection entryCriterionCollection; + protected static ChildElementCollection exitCriterionCollection; + + public DiscretionaryItemImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getName() { + return nameAttribute.getValue(this); + } + + public void setName(String name) { + nameAttribute.setValue(this, name); + } + + public PlanItemDefinition getDefinition() { + return definitionRefAttribute.getReferenceTargetElement(this); + } + + public void setDefinition(PlanItemDefinition definition) { + definitionRefAttribute.setReferenceTargetElement(this, definition); + } + + public ItemControl getItemControl() { + return itemControlChild.getChild(this); + } + + public void setItemControl(ItemControl itemControl) { + itemControlChild.setChild(this, itemControl); + } + + public Collection getEntryCriterions() { + return entryCriterionCollection.get(this); + } + + public Collection getExitCriterions() { + return exitCriterionCollection.get(this); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(DiscretionaryItem.class, CMMN_ELEMENT_DISCRETIONARY_ITEM) + .namespaceUri(CMMN11_NS) + .extendsType(TableItem.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public DiscretionaryItem newInstance(ModelTypeInstanceContext instanceContext) { + return new DiscretionaryItemImpl(instanceContext); + } + }); + + nameAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_NAME) + .build(); + + definitionRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_DEFINITION_REF) + .idAttributeReference(PlanItemDefinition.class) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + itemControlChild = sequenceBuilder.element(ItemControl.class) + .build(); + + entryCriterionCollection = sequenceBuilder.elementCollection(EntryCriterion.class) + .build(); + + exitCriterionCollection = sequenceBuilder.elementCollection(ExitCriterion.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/DocumentationImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/DocumentationImpl.java new file mode 100644 index 00000000000..a7a138966ee --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/DocumentationImpl.java @@ -0,0 +1,80 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_ID; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_TEXT_FORMAT; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_DOCUMENTATION; + +import org.camunda.bpm.model.cmmn.instance.Documentation; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; + +/** + * @author Roman Smirnov + * + */ +public class DocumentationImpl extends CmmnModelElementInstanceImpl implements Documentation { + + protected static Attribute idAttribute; + protected static Attribute textFormatAttribute; + + public DocumentationImpl(ModelTypeInstanceContext context) { + super(context); + } + + public String getId() { + return idAttribute.getValue(this); + } + + public void setId(String id) { + idAttribute.setValue(this, id); + } + + public String getTextFormat() { + return textFormatAttribute.getValue(this); + } + + public void setTextFormat(String textFormat) { + textFormatAttribute.setValue(this, textFormat); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Documentation.class, CMMN_ELEMENT_DOCUMENTATION) + .namespaceUri(CMMN11_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public Documentation newInstance(ModelTypeInstanceContext instanceContext) { + return new DocumentationImpl(instanceContext); + } + }); + + idAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_ID) + .idAttribute() + .build(); + + textFormatAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_TEXT_FORMAT) + .defaultValue("text/plain") + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/EntryCriterionImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/EntryCriterionImpl.java new file mode 100644 index 00000000000..7124409e00b --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/EntryCriterionImpl.java @@ -0,0 +1,52 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_ENTRY_CRITERION; + +import org.camunda.bpm.model.cmmn.instance.Criterion; +import org.camunda.bpm.model.cmmn.instance.EntryCriterion; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; + +/** + * @author Roman Smirnov + * + */ +public class EntryCriterionImpl extends CriterionImpl implements EntryCriterion { + + public EntryCriterionImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(EntryCriterion.class, CMMN_ELEMENT_ENTRY_CRITERION) + .extendsType(Criterion.class) + .namespaceUri(CMMN11_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public EntryCriterion newInstance(ModelTypeInstanceContext instanceContext) { + return new EntryCriterionImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/EventImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/EventImpl.java new file mode 100644 index 00000000000..f9579775379 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/EventImpl.java @@ -0,0 +1,52 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN10_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_EVENT; + +import org.camunda.bpm.model.cmmn.instance.Event; +import org.camunda.bpm.model.cmmn.instance.PlanItemDefinition; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; + +/** + * @author Roman Smirnov + * + */ +public class EventImpl extends PlanItemDefinitionImpl implements Event { + + public EventImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Event.class, CMMN_ELEMENT_EVENT) + .namespaceUri(CMMN10_NS) + .extendsType(PlanItemDefinition.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public Event newInstance(ModelTypeInstanceContext instanceContext) { + return new EventImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/EventListenerImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/EventListenerImpl.java new file mode 100644 index 00000000000..0446d80250d --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/EventListenerImpl.java @@ -0,0 +1,52 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_EVENT_LISTENER; + +import org.camunda.bpm.model.cmmn.instance.EventListener; +import org.camunda.bpm.model.cmmn.instance.PlanItemDefinition; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; + +/** + * @author Roman Smirnov + * + */ +public class EventListenerImpl extends PlanItemDefinitionImpl implements EventListener { + + public EventListenerImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(EventListener.class, CMMN_ELEMENT_EVENT_LISTENER) + .namespaceUri(CMMN11_NS) + .extendsType(PlanItemDefinition.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public EventListener newInstance(ModelTypeInstanceContext instanceContext) { + return new EventListenerImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ExitCriterionImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ExitCriterionImpl.java new file mode 100644 index 00000000000..7a451644163 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ExitCriterionImpl.java @@ -0,0 +1,52 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_EXIT_CRITERION; + +import org.camunda.bpm.model.cmmn.instance.Criterion; +import org.camunda.bpm.model.cmmn.instance.ExitCriterion; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; + +/** + * @author Roman Smirnov + * + */ +public class ExitCriterionImpl extends CriterionImpl implements ExitCriterion { + + public ExitCriterionImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(ExitCriterion.class, CMMN_ELEMENT_EXIT_CRITERION) + .extendsType(Criterion.class) + .namespaceUri(CMMN11_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public ExitCriterion newInstance(ModelTypeInstanceContext instanceContext) { + return new ExitCriterionImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ExpressionImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ExpressionImpl.java new file mode 100644 index 00000000000..f6cea2b3269 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ExpressionImpl.java @@ -0,0 +1,110 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_LANGUAGE; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_EXPRESSION; + +import org.camunda.bpm.model.cmmn.instance.Body; +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.cmmn.instance.Expression; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public class ExpressionImpl extends CmmnElementImpl implements Expression { + + protected static Attribute languageAttribute; + + // cmmn 1.0 + @Deprecated + protected static ChildElement bodyChild; + + public ExpressionImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getText() { + if (isCmmn11()) { + return getTextContent(); + } + else { + return getBody(); + } + } + + public void setText(String text) { + if (isCmmn11()) { + setTextContent(text); + } + else { + setBody(text); + } + } + + public String getBody() { + Body body = bodyChild.getChild(this); + if (body != null) { + return body.getTextContent(); + } + return null; + } + + public void setBody(String body) { + bodyChild.getChild(this).setTextContent(body); + } + + public String getLanguage() { + return languageAttribute.getValue(this); + } + + public void setLanguage(String language) { + languageAttribute.setValue(this, language); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Expression.class, CMMN_ELEMENT_EXPRESSION) + .namespaceUri(CMMN11_NS) + .extendsType(CmmnElement.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public Expression newInstance(ModelTypeInstanceContext instanceContext) { + return new ExpressionImpl(instanceContext); + } + }); + + languageAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_LANGUAGE) + .defaultValue("http://www.w3.org/1999/XPath") + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + bodyChild = sequenceBuilder.element(Body.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ExtensionElementsImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ExtensionElementsImpl.java new file mode 100644 index 00000000000..5c92f02cd45 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ExtensionElementsImpl.java @@ -0,0 +1,82 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_EXTENSION_ELEMENTS; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.Query; +import org.camunda.bpm.model.cmmn.impl.QueryImpl; +import org.camunda.bpm.model.cmmn.instance.ExtensionElements; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.impl.util.ModelUtil; +import org.camunda.bpm.model.xml.instance.ModelElementInstance; +import org.camunda.bpm.model.xml.type.ModelElementType; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; + +/** + * @author Roman Smirnov + * + */ +public class ExtensionElementsImpl extends CmmnModelElementInstanceImpl implements ExtensionElements { + + public static void registerType(ModelBuilder modelBuilder) { + + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(ExtensionElements.class, CMMN_ELEMENT_EXTENSION_ELEMENTS) + .namespaceUri(CMMN11_NS) + .instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider() { + public ExtensionElements newInstance(ModelTypeInstanceContext instanceContext) { + return new ExtensionElementsImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + + public ExtensionElementsImpl(ModelTypeInstanceContext context) { + super(context); + } + + public Collection getElements() { + return ModelUtil.getModelElementCollection(getDomElement().getChildElements(), modelInstance); + } + + public Query getElementsQuery() { + return new QueryImpl(getElements()); + } + + public ModelElementInstance addExtensionElement(String namespaceUri, String localName) { + ModelElementType extensionElementType = modelInstance.registerGenericType(namespaceUri, localName); + ModelElementInstance extensionElement = extensionElementType.newInstance(modelInstance); + addChildElement(extensionElement); + return extensionElement; + } + + public T addExtensionElement(Class extensionElementClass) { + ModelElementInstance extensionElement = modelInstance.newInstance(extensionElementClass); + addChildElement(extensionElement); + return extensionElementClass.cast(extensionElement); + } + + @Override + public void addChildElement(ModelElementInstance extensionElement) { + getDomElement().appendChild(extensionElement.getDomElement()); + } +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/HumanTaskImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/HumanTaskImpl.java new file mode 100644 index 00000000000..18c4f44d588 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/HumanTaskImpl.java @@ -0,0 +1,232 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_ASSIGNEE; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_CANDIDATE_GROUPS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_CANDIDATE_USERS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_DUE_DATE; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_FOLLOW_UP_DATE; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_FORM_KEY; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_PRIORITY; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_PERFORMER_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_HUMAN_TASK; + +import java.util.Collection; +import java.util.List; + +import org.camunda.bpm.model.cmmn.instance.HumanTask; +import org.camunda.bpm.model.cmmn.instance.PlanningTable; +import org.camunda.bpm.model.cmmn.instance.Role; +import org.camunda.bpm.model.cmmn.instance.Task; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.impl.util.StringUtil; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.ChildElementCollection; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; +import org.camunda.bpm.model.xml.type.reference.AttributeReference; + +/** + * @author Roman Smirnov + * + */ +public class HumanTaskImpl extends TaskImpl implements HumanTask { + + protected static AttributeReference performerRefAttribute; + + // cmmn 1.0 + @Deprecated + protected static ChildElementCollection planningTableCollection; + + // cmmn 1.1 + protected static ChildElement planningTableChild; + + /** camunda extensions */ + protected static Attribute camundaAssigneeAttribute; + protected static Attribute camundaCandidateGroupsAttribute; + protected static Attribute camundaCandidateUsersAttribute; + protected static Attribute camundaDueDateAttribute; + protected static Attribute camundaFollowUpDateAttribute; + protected static Attribute camundaFormKeyAttribute; + protected static Attribute camundaPriorityAttribute; + + public HumanTaskImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public Role getPerformer() { + return performerRefAttribute.getReferenceTargetElement(this); + } + + public void setPerformer(Role performer) { + performerRefAttribute.setReferenceTargetElement(this, performer); + } + + public Collection getPlanningTables() { + return planningTableCollection.get(this); + } + + public PlanningTable getPlanningTable() { + return planningTableChild.getChild(this); + } + + public void setPlanningTable(PlanningTable planningTable) { + planningTableChild.setChild(this, planningTable); + } + + /** camunda extensions */ + + public String getCamundaAssignee() { + return camundaAssigneeAttribute.getValue(this); + } + + public void setCamundaAssignee(String camundaAssignee) { + camundaAssigneeAttribute.setValue(this, camundaAssignee); + } + + public String getCamundaCandidateGroups() { + return camundaCandidateGroupsAttribute.getValue(this); + } + + public void setCamundaCandidateGroups(String camundaCandidateGroups) { + camundaCandidateGroupsAttribute.setValue(this, camundaCandidateGroups); + } + + public List getCamundaCandidateGroupsList() { + String candidateGroups = camundaCandidateGroupsAttribute.getValue(this); + return StringUtil.splitCommaSeparatedList(candidateGroups); + } + + public void setCamundaCandidateGroupsList(List camundaCandidateGroupsList) { + String candidateGroups = StringUtil.joinCommaSeparatedList(camundaCandidateGroupsList); + camundaCandidateGroupsAttribute.setValue(this, candidateGroups); + } + + public String getCamundaCandidateUsers() { + return camundaCandidateUsersAttribute.getValue(this); + } + + public void setCamundaCandidateUsers(String camundaCandidateUsers) { + camundaCandidateUsersAttribute.setValue(this, camundaCandidateUsers); + } + + public List getCamundaCandidateUsersList() { + String candidateUsers = camundaCandidateUsersAttribute.getValue(this); + return StringUtil.splitCommaSeparatedList(candidateUsers); + } + + public void setCamundaCandidateUsersList(List camundaCandidateUsersList) { + String candidateUsers = StringUtil.joinCommaSeparatedList(camundaCandidateUsersList); + camundaCandidateUsersAttribute.setValue(this, candidateUsers); + } + + public String getCamundaDueDate() { + return camundaDueDateAttribute.getValue(this); + } + + public void setCamundaDueDate(String camundaDueDate) { + camundaDueDateAttribute.setValue(this, camundaDueDate); + } + + public String getCamundaFollowUpDate() { + return camundaFollowUpDateAttribute.getValue(this); + } + + public void setCamundaFollowUpDate(String camundaFollowUpDate) { + camundaFollowUpDateAttribute.setValue(this, camundaFollowUpDate); + } + + public String getCamundaFormKey() { + return camundaFormKeyAttribute.getValue(this); + } + + public void setCamundaFormKey(String camundaFormKey) { + camundaFormKeyAttribute.setValue(this, camundaFormKey); + } + + public String getCamundaPriority() { + return camundaPriorityAttribute.getValue(this); + } + + public void setCamundaPriority(String camundaPriority) { + camundaPriorityAttribute.setValue(this, camundaPriority); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(HumanTask.class, CMMN_ELEMENT_HUMAN_TASK) + .namespaceUri(CMMN11_NS) + .extendsType(Task.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public HumanTask newInstance(ModelTypeInstanceContext instanceContext) { + return new HumanTaskImpl(instanceContext); + } + }); + + performerRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_PERFORMER_REF) + .idAttributeReference(Role.class) + .build(); + + /** camunda extensions */ + + camundaAssigneeAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_ASSIGNEE) + .namespace(CAMUNDA_NS) + .build(); + + camundaCandidateGroupsAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_CANDIDATE_GROUPS) + .namespace(CAMUNDA_NS) + .build(); + + camundaCandidateUsersAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_CANDIDATE_USERS) + .namespace(CAMUNDA_NS) + .build(); + + camundaDueDateAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_DUE_DATE) + .namespace(CAMUNDA_NS) + .build(); + + camundaFollowUpDateAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_FOLLOW_UP_DATE) + .namespace(CAMUNDA_NS) + .build(); + + camundaFormKeyAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_FORM_KEY) + .namespace(CAMUNDA_NS) + .build(); + + camundaPriorityAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_PRIORITY) + .namespace(CAMUNDA_NS) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + planningTableCollection = sequenceBuilder.elementCollection(PlanningTable.class) + .build(); + + planningTableChild = sequenceBuilder.element(PlanningTable.class) + .minOccurs(0) + .maxOccurs(1) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/IfPartImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/IfPartImpl.java new file mode 100644 index 00000000000..c4e06dad762 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/IfPartImpl.java @@ -0,0 +1,94 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_CONTEXT_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_IF_PART; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.CaseFileItem; +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.cmmn.instance.ConditionExpression; +import org.camunda.bpm.model.cmmn.instance.IfPart; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; +import org.camunda.bpm.model.xml.type.reference.AttributeReference; + +/** + * @author Roman Smirnov + * + */ +public class IfPartImpl extends CmmnElementImpl implements IfPart { + + protected static AttributeReference contextRefAttribute; + + // cmmn 1.1 + protected static ChildElement conditionChild; + + public IfPartImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public CaseFileItem getContext() { + return contextRefAttribute.getReferenceTargetElement(this); + } + + public void setContext(CaseFileItem caseFileItem) { + contextRefAttribute.setReferenceTargetElement(this, caseFileItem); + } + + public Collection getConditions() { + return conditionChild.get(this); + } + + public ConditionExpression getCondition() { + return conditionChild.getChild(this); + } + + public void setCondition(ConditionExpression condition) { + conditionChild.setChild(this, condition); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(IfPart.class, CMMN_ELEMENT_IF_PART) + .namespaceUri(CMMN11_NS) + .extendsType(CmmnElement.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public IfPart newInstance(ModelTypeInstanceContext instanceContext) { + return new IfPartImpl(instanceContext); + } + }); + + contextRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_CONTEXT_REF) + .idAttributeReference(CaseFileItem.class) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + conditionChild = sequenceBuilder.element(ConditionExpression.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ImportImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ImportImpl.java new file mode 100644 index 00000000000..64bb38dfd49 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ImportImpl.java @@ -0,0 +1,93 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_IMPORT_TYPE; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_LOCATION; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_NAMESPACE; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_IMPORT; + +import org.camunda.bpm.model.cmmn.instance.Import; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; + +/** + * @author Roman Smirnov + * + */ +public class ImportImpl extends CmmnModelElementInstanceImpl implements Import { + + protected static Attribute locationAttribute; + protected static Attribute namespaceAttribute; + protected static Attribute importTypeAttribute; + + public ImportImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getNamespace() { + return namespaceAttribute.getValue(this); + } + + public void setNamespace(String namespace) { + namespaceAttribute.setValue(this, namespace); + } + + public String getLocation() { + return locationAttribute.getValue(this); + } + + public void setLocation(String location) { + locationAttribute.setValue(this, location); + } + + public String getImportType() { + return importTypeAttribute.getValue(this); + } + + public void setImportType(String importType) { + importTypeAttribute.setValue(this, importType); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Import.class, CMMN_ELEMENT_IMPORT) + .namespaceUri(CMMN11_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public Import newInstance(ModelTypeInstanceContext instanceContext) { + return new ImportImpl(instanceContext); + } + }); + + namespaceAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_NAMESPACE) + .build(); + + locationAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_LOCATION) + .required() + .build(); + + importTypeAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_IMPORT_TYPE) + .required() + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/InputCaseParameterImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/InputCaseParameterImpl.java new file mode 100644 index 00000000000..f273f645c22 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/InputCaseParameterImpl.java @@ -0,0 +1,51 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_INPUT; + +import org.camunda.bpm.model.cmmn.instance.CaseParameter; +import org.camunda.bpm.model.cmmn.instance.InputCaseParameter; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; + +/** + * @author Roman Smirnov + * + */ +public class InputCaseParameterImpl extends CaseParameterImpl implements InputCaseParameter { + + public InputCaseParameterImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(InputCaseParameter.class, CMMN_ELEMENT_INPUT) + .namespaceUri(CMMN11_NS) + .extendsType(CaseParameter.class) + .instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider() { + public InputCaseParameter newInstance(ModelTypeInstanceContext instanceContext) { + return new InputCaseParameterImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/InputDecisionParameterImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/InputDecisionParameterImpl.java new file mode 100644 index 00000000000..8ecbdf7cfcf --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/InputDecisionParameterImpl.java @@ -0,0 +1,52 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_INPUT; + +import org.camunda.bpm.model.cmmn.instance.DecisionParameter; +import org.camunda.bpm.model.cmmn.instance.InputDecisionParameter; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; + +/** + * @author Roman Smirnov + * + */ +public class InputDecisionParameterImpl extends DecisionParameterImpl implements InputDecisionParameter { + + public InputDecisionParameterImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(InputDecisionParameter.class, CMMN_ELEMENT_INPUT) + .namespaceUri(CMMN11_NS) + .extendsType(DecisionParameter.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public InputDecisionParameter newInstance(ModelTypeInstanceContext instanceContext) { + return new InputDecisionParameterImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/InputProcessParameterImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/InputProcessParameterImpl.java new file mode 100644 index 00000000000..fcb14ad1191 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/InputProcessParameterImpl.java @@ -0,0 +1,51 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_INPUT; + +import org.camunda.bpm.model.cmmn.instance.InputProcessParameter; +import org.camunda.bpm.model.cmmn.instance.ProcessParameter; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; + +/** + * @author Roman Smirnov + * + */ +public class InputProcessParameterImpl extends ProcessParameterImpl implements InputProcessParameter { + + public InputProcessParameterImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(InputProcessParameter.class, CMMN_ELEMENT_INPUT) + .namespaceUri(CMMN11_NS) + .extendsType(ProcessParameter.class) + .instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider() { + public InputProcessParameter newInstance(ModelTypeInstanceContext instanceContext) { + return new InputProcessParameterImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/InputsCaseParameterImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/InputsCaseParameterImpl.java new file mode 100644 index 00000000000..15e26b10edf --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/InputsCaseParameterImpl.java @@ -0,0 +1,51 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN10_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_INPUTS; + +import org.camunda.bpm.model.cmmn.instance.CaseParameter; +import org.camunda.bpm.model.cmmn.instance.InputsCaseParameter; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; + +/** + * @author Roman Smirnov + * + */ +public class InputsCaseParameterImpl extends CaseParameterImpl implements InputsCaseParameter { + + public InputsCaseParameterImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(InputsCaseParameter.class, CMMN_ELEMENT_INPUTS) + .namespaceUri(CMMN10_NS) + .extendsType(CaseParameter.class) + .instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider() { + public InputsCaseParameter newInstance(ModelTypeInstanceContext instanceContext) { + return new InputsCaseParameterImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ItemControlImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ItemControlImpl.java new file mode 100644 index 00000000000..e00babf0dfa --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ItemControlImpl.java @@ -0,0 +1,52 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_ITEM_CONTROL; + +import org.camunda.bpm.model.cmmn.instance.ItemControl; +import org.camunda.bpm.model.cmmn.instance.PlanItemControl; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; + +/** + * @author Roman Smirnov + * + */ +public class ItemControlImpl extends PlanItemControlImpl implements ItemControl { + + public ItemControlImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(ItemControl.class, CMMN_ELEMENT_ITEM_CONTROL) + .namespaceUri(CMMN11_NS) + .extendsType(PlanItemControl.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public ItemControl newInstance(ModelTypeInstanceContext instanceContext) { + return new ItemControlImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ManualActivationRuleImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ManualActivationRuleImpl.java new file mode 100644 index 00000000000..b2d650c650d --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ManualActivationRuleImpl.java @@ -0,0 +1,100 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_CONTEXT_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_NAME; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_MANUAL_ACTIVATION_RULE; + +import org.camunda.bpm.model.cmmn.instance.CaseFileItem; +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.cmmn.instance.ConditionExpression; +import org.camunda.bpm.model.cmmn.instance.ManualActivationRule; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; +import org.camunda.bpm.model.xml.type.reference.AttributeReference; + +/** + * @author Roman Smirnov + * + */ +public class ManualActivationRuleImpl extends CmmnElementImpl implements ManualActivationRule { + + protected static Attribute nameAttribute; + protected static AttributeReference contextRefAttribute; + protected static ChildElement conditionChild; + + public ManualActivationRuleImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getName() { + return nameAttribute.getValue(this); + } + + public void setName(String name) { + nameAttribute.setValue(this, name); + } + + public CaseFileItem getContext() { + return contextRefAttribute.getReferenceTargetElement(this); + } + + public void setContext(CaseFileItem caseFileItem) { + contextRefAttribute.setReferenceTargetElement(this, caseFileItem); + } + + public ConditionExpression getCondition() { + return conditionChild.getChild(this); + } + + public void setCondition(ConditionExpression condition) { + conditionChild.setChild(this, condition); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(ManualActivationRule.class, CMMN_ELEMENT_MANUAL_ACTIVATION_RULE) + .namespaceUri(CMMN11_NS) + .extendsType(CmmnElement.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public ManualActivationRule newInstance(ModelTypeInstanceContext instanceContext) { + return new ManualActivationRuleImpl(instanceContext); + } + }); + + nameAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_NAME) + .build(); + + contextRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_CONTEXT_REF) + .idAttributeReference(CaseFileItem.class) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + conditionChild = sequenceBuilder.element(ConditionExpression.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/MilestoneImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/MilestoneImpl.java new file mode 100644 index 00000000000..e8e074f3080 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/MilestoneImpl.java @@ -0,0 +1,52 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_MILESTONE; + +import org.camunda.bpm.model.cmmn.instance.Milestone; +import org.camunda.bpm.model.cmmn.instance.PlanItemDefinition; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; + +/** + * @author Roman Smirnov + * + */ +public class MilestoneImpl extends PlanItemDefinitionImpl implements Milestone { + + public MilestoneImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Milestone.class, CMMN_ELEMENT_MILESTONE) + .namespaceUri(CMMN11_NS) + .extendsType(PlanItemDefinition.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public Milestone newInstance(ModelTypeInstanceContext instanceContext) { + return new MilestoneImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/OnPartImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/OnPartImpl.java new file mode 100644 index 00000000000..b2431b7f904 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/OnPartImpl.java @@ -0,0 +1,47 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_ON_PART; + +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.cmmn.instance.OnPart; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; + +/** + * @author Roman Smirnov + * + */ +public abstract class OnPartImpl extends CmmnElementImpl implements OnPart { + + public OnPartImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(OnPart.class, CMMN_ELEMENT_ON_PART) + .extendsType(CmmnElement.class) + .namespaceUri(CMMN11_NS) + .abstractType(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/OutputCaseParameterImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/OutputCaseParameterImpl.java new file mode 100644 index 00000000000..eded6c3f579 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/OutputCaseParameterImpl.java @@ -0,0 +1,51 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_OUTPUT; + +import org.camunda.bpm.model.cmmn.instance.CaseParameter; +import org.camunda.bpm.model.cmmn.instance.OutputCaseParameter; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; + +/** + * @author Roman Smirnov + * + */ +public class OutputCaseParameterImpl extends CaseParameterImpl implements OutputCaseParameter { + + public OutputCaseParameterImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(OutputCaseParameter.class, CMMN_ELEMENT_OUTPUT) + .namespaceUri(CMMN11_NS) + .extendsType(CaseParameter.class) + .instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider() { + public OutputCaseParameter newInstance(ModelTypeInstanceContext instanceContext) { + return new OutputCaseParameterImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/OutputDecisionParameterImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/OutputDecisionParameterImpl.java new file mode 100644 index 00000000000..2caaeaf295d --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/OutputDecisionParameterImpl.java @@ -0,0 +1,52 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_OUTPUT; + +import org.camunda.bpm.model.cmmn.instance.DecisionParameter; +import org.camunda.bpm.model.cmmn.instance.OutputDecisionParameter; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; + +/** + * @author Roman Smirnov + * + */ +public class OutputDecisionParameterImpl extends DecisionParameterImpl implements OutputDecisionParameter { + + public OutputDecisionParameterImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(OutputDecisionParameter.class, CMMN_ELEMENT_OUTPUT) + .namespaceUri(CMMN11_NS) + .extendsType(DecisionParameter.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public OutputDecisionParameter newInstance(ModelTypeInstanceContext instanceContext) { + return new OutputDecisionParameterImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/OutputProcessParameterImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/OutputProcessParameterImpl.java new file mode 100644 index 00000000000..c6d5cb4212b --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/OutputProcessParameterImpl.java @@ -0,0 +1,51 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_OUTPUT; + +import org.camunda.bpm.model.cmmn.instance.OutputProcessParameter; +import org.camunda.bpm.model.cmmn.instance.ProcessParameter; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; + +/** + * @author Roman Smirnov + * + */ +public class OutputProcessParameterImpl extends ProcessParameterImpl implements OutputProcessParameter { + + public OutputProcessParameterImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(OutputProcessParameter.class, CMMN_ELEMENT_OUTPUT) + .namespaceUri(CMMN11_NS) + .extendsType(ProcessParameter.class) + .instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider() { + public OutputProcessParameter newInstance(ModelTypeInstanceContext instanceContext) { + return new OutputProcessParameterImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/OutputsCaseParameterImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/OutputsCaseParameterImpl.java new file mode 100644 index 00000000000..b5982a33501 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/OutputsCaseParameterImpl.java @@ -0,0 +1,51 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN10_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_OUTPUTS; + +import org.camunda.bpm.model.cmmn.instance.CaseParameter; +import org.camunda.bpm.model.cmmn.instance.OutputsCaseParameter; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; + +/** + * @author Roman Smirnov + * + */ +public class OutputsCaseParameterImpl extends CaseParameterImpl implements OutputsCaseParameter { + + public OutputsCaseParameterImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(OutputsCaseParameter.class, CMMN_ELEMENT_OUTPUTS) + .namespaceUri(CMMN10_NS) + .extendsType(CaseParameter.class) + .instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider() { + public OutputsCaseParameter newInstance(ModelTypeInstanceContext instanceContext) { + return new OutputsCaseParameterImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ParameterImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ParameterImpl.java new file mode 100644 index 00000000000..fc88acd6a99 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ParameterImpl.java @@ -0,0 +1,62 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_NAME; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_PARAMETER; + +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.cmmn.instance.Parameter; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.attribute.Attribute; + +/** + * @author Roman Smirnov + * + */ +public abstract class ParameterImpl extends CmmnElementImpl implements Parameter { + + protected static Attribute nameAttribute; + + public ParameterImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getName() { + return nameAttribute.getValue(this); + } + + public void setName(String name) { + nameAttribute.setValue(this, name); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Parameter.class, CMMN_ELEMENT_PARAMETER) + .namespaceUri(CMMN11_NS) + .extendsType(CmmnElement.class) + .abstractType(); + + nameAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_NAME) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ParameterMappingImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ParameterMappingImpl.java new file mode 100644 index 00000000000..9387bc41743 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ParameterMappingImpl.java @@ -0,0 +1,101 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_SOURCE_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_TARGET_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_PARAMETER_MAPPING; + +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.cmmn.instance.Parameter; +import org.camunda.bpm.model.cmmn.instance.ParameterMapping; +import org.camunda.bpm.model.cmmn.instance.TransformationExpression; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; +import org.camunda.bpm.model.xml.type.reference.AttributeReference; + +/** + * @author Roman Smirnov + * + */ +public class ParameterMappingImpl extends CmmnElementImpl implements ParameterMapping { + + protected static AttributeReference sourceRefAttribute; + protected static AttributeReference targetRefAttribute; + + protected static ChildElement transformationChild; + + public ParameterMappingImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public Parameter getSource() { + return sourceRefAttribute.getReferenceTargetElement(this); + } + + public void setSource(Parameter parameter) { + sourceRefAttribute.setReferenceTargetElement(this, parameter); + } + + public Parameter getTarget() { + return targetRefAttribute.getReferenceTargetElement(this); + } + + public void setTarget(Parameter parameter) { + targetRefAttribute.setReferenceTargetElement(this, parameter); + } + + public TransformationExpression getTransformation() { + return transformationChild.getChild(this); + } + + public void setTransformation(TransformationExpression transformationExpression) { + transformationChild.setChild(this, transformationExpression); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(ParameterMapping.class, CMMN_ELEMENT_PARAMETER_MAPPING) + .extendsType(CmmnElement.class) + .namespaceUri(CMMN11_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public ParameterMapping newInstance(ModelTypeInstanceContext instanceContext) { + return new ParameterMappingImpl(instanceContext); + } + }); + + sourceRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_SOURCE_REF) + .idAttributeReference(Parameter.class) + .build(); + + targetRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_TARGET_REF) + .idAttributeReference(Parameter.class) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + transformationChild = sequenceBuilder.element(TransformationExpression.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PlanFragmentImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PlanFragmentImpl.java new file mode 100644 index 00000000000..faff764f810 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PlanFragmentImpl.java @@ -0,0 +1,77 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_PLAN_FRAGMENT; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.PlanFragment; +import org.camunda.bpm.model.cmmn.instance.PlanItem; +import org.camunda.bpm.model.cmmn.instance.PlanItemDefinition; +import org.camunda.bpm.model.cmmn.instance.Sentry; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.child.ChildElementCollection; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public class PlanFragmentImpl extends PlanItemDefinitionImpl implements PlanFragment { + + protected static ChildElementCollection planItemCollection; + protected static ChildElementCollection sentryCollection; + + public PlanFragmentImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public Collection getPlanItems() { + return planItemCollection.get(this); + } + + public Collection getSentrys() { + return sentryCollection.get(this); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(PlanFragment.class, CMMN_ELEMENT_PLAN_FRAGMENT) + .namespaceUri(CMMN11_NS) + .extendsType(PlanItemDefinition.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public PlanFragment newInstance(ModelTypeInstanceContext instanceContext) { + return new PlanFragmentImpl(instanceContext); + } + }); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + planItemCollection = sequenceBuilder.elementCollection(PlanItem.class) + .build(); + + sentryCollection = sequenceBuilder.elementCollection(Sentry.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PlanItemControlImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PlanItemControlImpl.java new file mode 100644 index 00000000000..19699cbebb1 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PlanItemControlImpl.java @@ -0,0 +1,96 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_PLAN_ITEM_CONTROL; + +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.cmmn.instance.ManualActivationRule; +import org.camunda.bpm.model.cmmn.instance.PlanItemControl; +import org.camunda.bpm.model.cmmn.instance.RepetitionRule; +import org.camunda.bpm.model.cmmn.instance.RequiredRule; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public class PlanItemControlImpl extends CmmnElementImpl implements PlanItemControl { + + protected static ChildElement repetitionRuleChild; + protected static ChildElement requiredRuleChild; + protected static ChildElement manualActivationRuleChild; + + public PlanItemControlImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public RepetitionRule getRepetitionRule() { + return repetitionRuleChild.getChild(this); + } + + public void setRepetitionRule(RepetitionRule repetitionRule) { + repetitionRuleChild.setChild(this, repetitionRule); + } + + public RequiredRule getRequiredRule() { + return requiredRuleChild.getChild(this); + } + + public void setRequiredRule(RequiredRule requiredRule) { + requiredRuleChild.setChild(this, requiredRule); + } + + public ManualActivationRule getManualActivationRule() { + return manualActivationRuleChild.getChild(this); + } + + public void setManualActivationRule(ManualActivationRule manualActivationRule) { + manualActivationRuleChild.setChild(this, manualActivationRule); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(PlanItemControl.class, CMMN_ELEMENT_PLAN_ITEM_CONTROL) + .namespaceUri(CMMN11_NS) + .extendsType(CmmnElement.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public PlanItemControl newInstance(ModelTypeInstanceContext instanceContext) { + return new PlanItemControlImpl(instanceContext); + } + }); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + repetitionRuleChild = sequenceBuilder.element(RepetitionRule.class) + .build(); + + requiredRuleChild = sequenceBuilder.element(RequiredRule.class) + .build(); + + manualActivationRuleChild = sequenceBuilder.element(ManualActivationRule.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PlanItemDefinitionImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PlanItemDefinitionImpl.java new file mode 100644 index 00000000000..2ac7cea0830 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PlanItemDefinitionImpl.java @@ -0,0 +1,79 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_NAME; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_PLAN_ITEM_DEFINITION; + +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.cmmn.instance.DefaultControl; +import org.camunda.bpm.model.cmmn.instance.PlanItemDefinition; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public abstract class PlanItemDefinitionImpl extends CmmnElementImpl implements PlanItemDefinition { + + protected static Attribute nameAttribute; + protected static ChildElement defaultControlChild; + + public PlanItemDefinitionImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getName() { + return nameAttribute.getValue(this); + } + + public void setName(String name) { + nameAttribute.setValue(this, name); + } + + public DefaultControl getDefaultControl() { + return defaultControlChild.getChild(this); + } + + public void setDefaultControl(DefaultControl defaultControl) { + defaultControlChild.setChild(this, defaultControl); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(PlanItemDefinition.class, CMMN_ELEMENT_PLAN_ITEM_DEFINITION) + .namespaceUri(CMMN11_NS) + .abstractType() + .extendsType(CmmnElement.class); + + nameAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_NAME) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + defaultControlChild = sequenceBuilder.element(DefaultControl.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PlanItemImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PlanItemImpl.java new file mode 100644 index 00000000000..16e2f2aa67a --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PlanItemImpl.java @@ -0,0 +1,189 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN10_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_DEFINITION_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_ENTRY_CRITERIA_REFS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_EXIT_CRITERIA_REFS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_NAME; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_PLAN_ITEM; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.cmmn.instance.EntryCriterion; +import org.camunda.bpm.model.cmmn.instance.ExitCriterion; +import org.camunda.bpm.model.cmmn.instance.ItemControl; +import org.camunda.bpm.model.cmmn.instance.PlanItem; +import org.camunda.bpm.model.cmmn.instance.PlanItemDefinition; +import org.camunda.bpm.model.cmmn.instance.Sentry; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.ChildElementCollection; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; +import org.camunda.bpm.model.xml.type.reference.AttributeReference; +import org.camunda.bpm.model.xml.type.reference.AttributeReferenceCollection; + +/** + * @author Roman Smirnov + * + */ +public class PlanItemImpl extends CmmnElementImpl implements PlanItem { + + protected static Attribute nameAttribute; + protected static AttributeReference planItemDefinitionRefAttribute; + protected static ChildElement itemControlChild; + + // cmmn 1.0 + @Deprecated + protected static AttributeReferenceCollection entryCriteriaRefCollection; + @Deprecated + protected static AttributeReferenceCollection exitCriteriaRefCollection; + + // cmmn 1.1 + protected static ChildElementCollection entryCriterionCollection; + protected static ChildElementCollection exitCriterionCollection; + + public PlanItemImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getName() { + return nameAttribute.getValue(this); + } + + public void setName(String name) { + nameAttribute.setValue(this, name); + } + + public PlanItemDefinition getDefinition() { + return planItemDefinitionRefAttribute.getReferenceTargetElement(this); + } + + public void setDefinition(PlanItemDefinition definition) { + planItemDefinitionRefAttribute.setReferenceTargetElement(this, definition); + } + + public Collection getEntryCriterias() { + return entryCriteriaRefCollection.getReferenceTargetElements(this); + } + + public Collection getExitCriterias() { + return exitCriteriaRefCollection.getReferenceTargetElements(this); + } + + public Collection getEntryCriteria() { + if (!isCmmn11()) { + return Collections.unmodifiableCollection(getEntryCriterias()); + } + else { + List sentries = new ArrayList(); + Collection entryCriterions = getEntryCriterions(); + for (EntryCriterion entryCriterion : entryCriterions) { + Sentry sentry = entryCriterion.getSentry(); + if (sentry != null) { + sentries.add(sentry); + } + } + return Collections.unmodifiableCollection(sentries); + } + } + + public Collection getExitCriteria() { + if (!isCmmn11()) { + return Collections.unmodifiableCollection(getExitCriterias()); + } + else { + List sentries = new ArrayList(); + Collection exitCriterions = getExitCriterions(); + for (ExitCriterion exitCriterion : exitCriterions) { + Sentry sentry = exitCriterion.getSentry(); + if (sentry != null) { + sentries.add(sentry); + } + } + return Collections.unmodifiableCollection(sentries); + } + } + + public Collection getEntryCriterions() { + return entryCriterionCollection.get(this); + } + + public Collection getExitCriterions() { + return exitCriterionCollection.get(this); + } + + public ItemControl getItemControl() { + return itemControlChild.getChild(this); + } + + public void setItemControl(ItemControl itemControl) { + itemControlChild.setChild(this, itemControl); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(PlanItem.class, CMMN_ELEMENT_PLAN_ITEM) + .namespaceUri(CMMN11_NS) + .extendsType(CmmnElement.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public PlanItem newInstance(ModelTypeInstanceContext instanceContext) { + return new PlanItemImpl(instanceContext); + } + }); + + nameAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_NAME) + .build(); + + planItemDefinitionRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_DEFINITION_REF) + .idAttributeReference(PlanItemDefinition.class) + .build(); + + entryCriteriaRefCollection = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_ENTRY_CRITERIA_REFS) + .namespace(CMMN10_NS) + .idAttributeReferenceCollection(Sentry.class, CmmnAttributeElementReferenceCollection.class) + .build(); + + exitCriteriaRefCollection = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_EXIT_CRITERIA_REFS) + .namespace(CMMN10_NS) + .idAttributeReferenceCollection(Sentry.class, CmmnAttributeElementReferenceCollection.class) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + itemControlChild = sequenceBuilder.element(ItemControl.class) + .build(); + + entryCriterionCollection = sequenceBuilder.elementCollection(EntryCriterion.class) + .build(); + + exitCriterionCollection = sequenceBuilder.elementCollection(ExitCriterion.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PlanItemOnPartImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PlanItemOnPartImpl.java new file mode 100644 index 00000000000..b8d60ffd179 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PlanItemOnPartImpl.java @@ -0,0 +1,126 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN10_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_EXIT_CRITERION_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_SENTRY_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_SOURCE_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_PLAN_ITEM_ON_PART; + +import org.camunda.bpm.model.cmmn.PlanItemTransition; +import org.camunda.bpm.model.cmmn.instance.ExitCriterion; +import org.camunda.bpm.model.cmmn.instance.OnPart; +import org.camunda.bpm.model.cmmn.instance.PlanItem; +import org.camunda.bpm.model.cmmn.instance.PlanItemOnPart; +import org.camunda.bpm.model.cmmn.instance.PlanItemTransitionStandardEvent; +import org.camunda.bpm.model.cmmn.instance.Sentry; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; +import org.camunda.bpm.model.xml.type.reference.AttributeReference; + +/** + * @author Roman Smirnov + * + */ +public class PlanItemOnPartImpl extends OnPartImpl implements PlanItemOnPart { + + protected static AttributeReference sourceRefAttribute; + protected static ChildElement standardEventChild; + + // cmmn 1.0 + @Deprecated + protected static AttributeReference sentryRefAttribute; + + // cmmn 1.1 + protected static AttributeReference exitCriterionRefAttribute; + + public PlanItemOnPartImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public Sentry getSentry() { + return sentryRefAttribute.getReferenceTargetElement(this); + } + + public void setSentry(Sentry sentry) { + sentryRefAttribute.setReferenceTargetElement(this, sentry); + } + + public ExitCriterion getExitCriterion() { + return exitCriterionRefAttribute.getReferenceTargetElement(this); + } + + public void setExitCriterion(ExitCriterion exitCriterion) { + exitCriterionRefAttribute.setReferenceTargetElement(this, exitCriterion); + } + + public PlanItem getSource() { + return sourceRefAttribute.getReferenceTargetElement(this); + } + + public void setSource(PlanItem source) { + sourceRefAttribute.setReferenceTargetElement(this, source); + } + + public PlanItemTransition getStandardEvent() { + PlanItemTransitionStandardEvent child = standardEventChild.getChild(this); + return child.getValue(); + } + + public void setStandardEvent(PlanItemTransition standardEvent) { + PlanItemTransitionStandardEvent child = standardEventChild.getChild(this); + child.setValue(standardEvent); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(PlanItemOnPart.class, CMMN_ELEMENT_PLAN_ITEM_ON_PART) + .extendsType(OnPart.class) + .namespaceUri(CMMN11_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public PlanItemOnPart newInstance(ModelTypeInstanceContext instanceContext) { + return new PlanItemOnPartImpl(instanceContext); + } + }); + + sourceRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_SOURCE_REF) + .idAttributeReference(PlanItem.class) + .build(); + + exitCriterionRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_EXIT_CRITERION_REF) + .idAttributeReference(ExitCriterion.class) + .build(); + + sentryRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_SENTRY_REF) + .namespace(CMMN10_NS) + .idAttributeReference(Sentry.class) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + standardEventChild = sequenceBuilder.element(PlanItemTransitionStandardEvent.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PlanItemStartTriggerImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PlanItemStartTriggerImpl.java new file mode 100644 index 00000000000..ecd928f5418 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PlanItemStartTriggerImpl.java @@ -0,0 +1,89 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_SOURCE_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_PLAN_ITEM_START_TRIGGER; + +import org.camunda.bpm.model.cmmn.PlanItemTransition; +import org.camunda.bpm.model.cmmn.instance.PlanItem; +import org.camunda.bpm.model.cmmn.instance.PlanItemStartTrigger; +import org.camunda.bpm.model.cmmn.instance.PlanItemTransitionStandardEvent; +import org.camunda.bpm.model.cmmn.instance.StartTrigger; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; +import org.camunda.bpm.model.xml.type.reference.AttributeReference; + +/** + * @author Roman Smirnov + * + */ +public class PlanItemStartTriggerImpl extends StartTriggerImpl implements PlanItemStartTrigger { + + protected static AttributeReference sourceRefAttribute; + protected static ChildElement standardEventChild; + + public PlanItemStartTriggerImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public PlanItem getSource() { + return sourceRefAttribute.getReferenceTargetElement(this); + } + + public void setSource(PlanItem source) { + sourceRefAttribute.setReferenceTargetElement(this, source); + } + + public PlanItemTransition getStandardEvent() { + PlanItemTransitionStandardEvent child = standardEventChild.getChild(this); + return child.getValue(); + } + + public void setStandardEvent(PlanItemTransition standardEvent) { + PlanItemTransitionStandardEvent child = standardEventChild.getChild(this); + child.setValue(standardEvent); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(PlanItemStartTrigger.class, CMMN_ELEMENT_PLAN_ITEM_START_TRIGGER) + .extendsType(StartTrigger.class) + .namespaceUri(CMMN11_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public PlanItemStartTrigger newInstance(ModelTypeInstanceContext instanceContext) { + return new PlanItemStartTriggerImpl(instanceContext); + } + }); + + sourceRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_SOURCE_REF) + .idAttributeReference(PlanItem.class) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + standardEventChild = sequenceBuilder.element(PlanItemTransitionStandardEvent.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PlanItemTransitionStandardEventImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PlanItemTransitionStandardEventImpl.java new file mode 100644 index 00000000000..fa39ce52d36 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PlanItemTransitionStandardEventImpl.java @@ -0,0 +1,59 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_STANDARD_EVENT; + +import org.camunda.bpm.model.cmmn.PlanItemTransition; +import org.camunda.bpm.model.cmmn.instance.PlanItemTransitionStandardEvent; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; + +/** + * @author Roman Smirnov + * + */ +public class PlanItemTransitionStandardEventImpl extends CmmnModelElementInstanceImpl implements PlanItemTransitionStandardEvent { + + public PlanItemTransitionStandardEventImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(PlanItemTransitionStandardEvent.class, CMMN_ELEMENT_STANDARD_EVENT) + .namespaceUri(CMMN11_NS) + .instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider() { + public PlanItemTransitionStandardEvent newInstance(ModelTypeInstanceContext instanceContext) { + return new PlanItemTransitionStandardEventImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + + public PlanItemTransition getValue() { + String standardEvent = getTextContent().trim(); + return Enum.valueOf(PlanItemTransition.class, standardEvent); + } + + public void setValue(PlanItemTransition value) { + setTextContent(value.toString()); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PlanningTableImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PlanningTableImpl.java new file mode 100644 index 00000000000..9be9c6471bf --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PlanningTableImpl.java @@ -0,0 +1,77 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_PLANNING_TABLE; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.ApplicabilityRule; +import org.camunda.bpm.model.cmmn.instance.PlanningTable; +import org.camunda.bpm.model.cmmn.instance.TableItem; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.child.ChildElementCollection; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public class PlanningTableImpl extends TableItemImpl implements PlanningTable { + + protected static ChildElementCollection tableItemCollection; + protected static ChildElementCollection applicabilityRuleCollection; + + public PlanningTableImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public Collection getTableItems() { + return tableItemCollection.get(this); + } + + public Collection getApplicabilityRules() { + return applicabilityRuleCollection.get(this); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(PlanningTable.class, CMMN_ELEMENT_PLANNING_TABLE) + .namespaceUri(CMMN11_NS) + .extendsType(TableItem.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public PlanningTable newInstance(ModelTypeInstanceContext instanceContext) { + return new PlanningTableImpl(instanceContext); + } + }); + + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + tableItemCollection = sequenceBuilder.elementCollection(TableItem.class) + .build(); + + applicabilityRuleCollection = sequenceBuilder.elementCollection(ApplicabilityRule.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ProcessImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ProcessImpl.java new file mode 100644 index 00000000000..dfd9c099b7b --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ProcessImpl.java @@ -0,0 +1,106 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_IMPLEMENTATION_TYPE; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_NAME; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_PROCESS; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.cmmn.instance.InputProcessParameter; +import org.camunda.bpm.model.cmmn.instance.OutputProcessParameter; +import org.camunda.bpm.model.cmmn.instance.Process; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElementCollection; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public class ProcessImpl extends CmmnElementImpl implements Process { + + protected static Attribute nameAttribute; + protected static Attribute implementationTypeAttribute; + + protected static ChildElementCollection inputCollection; + protected static ChildElementCollection outputCollection; + + public ProcessImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getName() { + return nameAttribute.getValue(this); + } + + public void setName(String name) { + nameAttribute.setValue(this, name); + } + + public String getImplementationType() { + return implementationTypeAttribute.getValue(this); + } + + public void setImplementationType(String implementationType) { + implementationTypeAttribute.setValue(this, implementationType); + } + + public Collection getInputs() { + return inputCollection.get(this); + } + + public Collection getOutputs() { + return outputCollection.get(this); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Process.class, CMMN_ELEMENT_PROCESS) + .extendsType(CmmnElement.class) + .namespaceUri(CMMN11_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public Process newInstance(ModelTypeInstanceContext instanceContext) { + return new ProcessImpl(instanceContext); + } + }); + + nameAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_NAME) + .build(); + + implementationTypeAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_IMPLEMENTATION_TYPE) + .defaultValue("http://www.omg.org/spec/CMMN/ProcessType/Unspecified") + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + inputCollection = sequenceBuilder.elementCollection(InputProcessParameter.class) + .build(); + + outputCollection = sequenceBuilder.elementCollection(OutputProcessParameter.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ProcessParameterImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ProcessParameterImpl.java new file mode 100644 index 00000000000..7b2583b797b --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ProcessParameterImpl.java @@ -0,0 +1,52 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_PROCESS_PARAMETER; + +import org.camunda.bpm.model.cmmn.instance.Parameter; +import org.camunda.bpm.model.cmmn.instance.ProcessParameter; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; + +/** + * @author Roman Smirnov + * + */ +public class ProcessParameterImpl extends ParameterImpl implements ProcessParameter { + + public ProcessParameterImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(ProcessParameter.class, CMMN_ELEMENT_PROCESS_PARAMETER) + .namespaceUri(CMMN11_NS) + .extendsType(Parameter.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public ProcessParameter newInstance(ModelTypeInstanceContext instanceContext) { + return new ProcessParameterImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ProcessRefExpressionImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ProcessRefExpressionImpl.java new file mode 100644 index 00000000000..c7baf99c2c1 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ProcessRefExpressionImpl.java @@ -0,0 +1,51 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_PROCESS_REF_EXPRESSION; + +import org.camunda.bpm.model.cmmn.instance.Expression; +import org.camunda.bpm.model.cmmn.instance.ProcessRefExpression; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; + +/** + * @author Roman Smirnov + * + */ +public class ProcessRefExpressionImpl extends ExpressionImpl implements ProcessRefExpression { + + public ProcessRefExpressionImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(ProcessRefExpression.class, CMMN_ELEMENT_PROCESS_REF_EXPRESSION) + .namespaceUri(CMMN11_NS) + .extendsType(Expression.class) + .instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider() { + public ProcessRefExpression newInstance(ModelTypeInstanceContext instanceContext) { + return new ProcessRefExpressionImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ProcessTaskImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ProcessTaskImpl.java new file mode 100644 index 00000000000..15683fe0d0b --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/ProcessTaskImpl.java @@ -0,0 +1,145 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_PROCESS_BINDING; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_PROCESS_VERSION; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_PROCESS_TENANT_ID; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_PROCESS_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_PROCESS_TASK; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.ParameterMapping; +import org.camunda.bpm.model.cmmn.instance.ProcessRefExpression; +import org.camunda.bpm.model.cmmn.instance.ProcessTask; +import org.camunda.bpm.model.cmmn.instance.Task; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.ChildElementCollection; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public class ProcessTaskImpl extends TaskImpl implements ProcessTask { + + protected static Attribute processRefAttribute; + protected static ChildElementCollection parameterMappingCollection; + protected static ChildElement processRefExpressionChild; + + protected static Attribute camundaProcessBindingAttribute; + protected static Attribute camundaProcessVersionAttribute; + protected static Attribute camundaProcessTenantIdAttribute; + + public ProcessTaskImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getProcess() { + return processRefAttribute.getValue(this); + } + + public void setProcess(String process) { + processRefAttribute.setValue(this, process); + } + + public ProcessRefExpression getProcessExpression() { + return processRefExpressionChild.getChild(this); + } + + public void setProcessExpression(ProcessRefExpression processExpression) { + processRefExpressionChild.setChild(this, processExpression); + } + + public Collection getParameterMappings() { + return parameterMappingCollection.get(this); + } + + public String getCamundaProcessBinding() { + return camundaProcessBindingAttribute.getValue(this); + } + + public void setCamundaProcessBinding(String camundaProcessBinding) { + camundaProcessBindingAttribute.setValue(this, camundaProcessBinding); + } + + public String getCamundaProcessVersion() { + return camundaProcessVersionAttribute.getValue(this); + } + + public void setCamundaProcessVersion(String camundaProcessVersion) { + camundaProcessVersionAttribute.setValue(this, camundaProcessVersion); + } + + public String getCamundaProcessTenantId() { + return camundaProcessTenantIdAttribute.getValue(this); + } + + public void setCamundaProcessTenantId(String camundaProcessTenantId) { + camundaProcessTenantIdAttribute.setValue(this, camundaProcessTenantId); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(ProcessTask.class, CMMN_ELEMENT_PROCESS_TASK) + .namespaceUri(CMMN11_NS) + .extendsType(Task.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public ProcessTask newInstance(ModelTypeInstanceContext instanceContext) { + return new ProcessTaskImpl(instanceContext); + } + }); + + processRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_PROCESS_REF) + .build(); + + /** camunda extensions */ + + camundaProcessBindingAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_PROCESS_BINDING) + .namespace(CAMUNDA_NS) + .build(); + + camundaProcessVersionAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_PROCESS_VERSION) + .namespace(CAMUNDA_NS) + .build(); + + camundaProcessTenantIdAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_PROCESS_TENANT_ID) + .namespace(CAMUNDA_NS) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + parameterMappingCollection = sequenceBuilder.elementCollection(ParameterMapping.class) + .build(); + + processRefExpressionChild = sequenceBuilder.element(ProcessRefExpression.class) + .minOccurs(0) + .maxOccurs(1) + .build(); + + typeBuilder.build(); + } + + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PropertyImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PropertyImpl.java new file mode 100644 index 00000000000..4f25839ae2b --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/PropertyImpl.java @@ -0,0 +1,80 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_NAME; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_TYPE; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_PROPERTY; + +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.cmmn.instance.Property; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; + +/** + * @author Roman Smirnov + * + */ +public class PropertyImpl extends CmmnElementImpl implements Property { + + protected static Attribute nameAttribute; + protected static Attribute typeAttribte; + + public PropertyImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getName() { + return nameAttribute.getValue(this); + } + + public void setName(String name) { + nameAttribute.setValue(this, name); + } + + public String getType() { + return typeAttribte.getValue(this); + } + + public void setType(String type) { + typeAttribte.setValue(this, type); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Property.class, CMMN_ELEMENT_PROPERTY) + .namespaceUri(CMMN11_NS) + .extendsType(CmmnElement.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public Property newInstance(ModelTypeInstanceContext instanceContext) { + return new PropertyImpl(instanceContext); + } + }); + + nameAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_NAME) + .build(); + + typeAttribte = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_TYPE) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/RelationshipImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/RelationshipImpl.java new file mode 100644 index 00000000000..3eea25b4082 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/RelationshipImpl.java @@ -0,0 +1,108 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_DIRECTION; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_TYPE; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_RELATIONSHIP; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.RelationshipDirection; +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.cmmn.instance.Relationship; +import org.camunda.bpm.model.cmmn.instance.Source; +import org.camunda.bpm.model.cmmn.instance.Target; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElementCollection; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public class RelationshipImpl extends CmmnElementImpl implements Relationship { + + protected static Attribute typeAttribute; + protected static Attribute directionAttribute; + protected static ChildElementCollection sourceCollection; + protected static ChildElementCollection targetCollection; + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Relationship.class, CMMN_ELEMENT_RELATIONSHIP) + .namespaceUri(CMMN11_NS) + .extendsType(CmmnElement.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public Relationship newInstance(ModelTypeInstanceContext instanceContext) { + return new RelationshipImpl(instanceContext); + } + }); + + typeAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_TYPE) + .required() + .build(); + + directionAttribute = typeBuilder.enumAttribute(CMMN_ATTRIBUTE_DIRECTION, RelationshipDirection.class) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + sourceCollection = sequenceBuilder.elementCollection(Source.class) + .minOccurs(1) + .build(); + + targetCollection = sequenceBuilder.elementCollection(Target.class) + .minOccurs(1) + .build(); + + typeBuilder.build(); + } + + public RelationshipImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getType() { + return typeAttribute.getValue(this); + } + + public void setType(String type) { + typeAttribute.setValue(this, type); + } + + public RelationshipDirection getDirection() { + return directionAttribute.getValue(this); + } + + public void setDirection(RelationshipDirection direction) { + directionAttribute.setValue(this, direction); + } + + public Collection getSources() { + return sourceCollection.get(this); + } + + public Collection getTargets() { + return targetCollection.get(this); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/RepetitionRuleImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/RepetitionRuleImpl.java new file mode 100644 index 00000000000..6a0293acfc3 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/RepetitionRuleImpl.java @@ -0,0 +1,119 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_REPEAT_ON_STANDARD_EVENT; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_CONTEXT_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_NAME; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_REPETITION_RULE; + +import org.camunda.bpm.model.cmmn.instance.CaseFileItem; +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.cmmn.instance.ConditionExpression; +import org.camunda.bpm.model.cmmn.instance.RepetitionRule; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; +import org.camunda.bpm.model.xml.type.reference.AttributeReference; + +/** + * @author Roman Smirnov + * + */ +public class RepetitionRuleImpl extends CmmnElementImpl implements RepetitionRule { + + protected static Attribute nameAttribute; + protected static AttributeReference contextRefAttribute; + protected static ChildElement conditionChild; + + /* Camunda extensions */ + protected static Attribute camundaRepeatOnStandardEventAttribute; + + public RepetitionRuleImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getName() { + return nameAttribute.getValue(this); + } + + public void setName(String name) { + nameAttribute.setValue(this, name); + } + + public CaseFileItem getContext() { + return contextRefAttribute.getReferenceTargetElement(this); + } + + public void setContext(CaseFileItem caseFileItem) { + contextRefAttribute.setReferenceTargetElement(this, caseFileItem); + } + + public ConditionExpression getCondition() { + return conditionChild.getChild(this); + } + + public void setCondition(ConditionExpression condition) { + conditionChild.setChild(this, condition); + } + + public String getCamundaRepeatOnStandardEvent() { + return camundaRepeatOnStandardEventAttribute.getValue(this); + } + + public void setCamundaRepeatOnStandardEvent(String standardEvent) { + camundaRepeatOnStandardEventAttribute.setValue(this, standardEvent); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(RepetitionRule.class, CMMN_ELEMENT_REPETITION_RULE) + .namespaceUri(CMMN11_NS) + .extendsType(CmmnElement.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public RepetitionRule newInstance(ModelTypeInstanceContext instanceContext) { + return new RepetitionRuleImpl(instanceContext); + } + }); + + nameAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_NAME) + .build(); + + contextRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_CONTEXT_REF) + .idAttributeReference(CaseFileItem.class) + .build(); + + /** Camunda extensions */ + + camundaRepeatOnStandardEventAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_REPEAT_ON_STANDARD_EVENT) + .namespace(CAMUNDA_NS) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + conditionChild = sequenceBuilder.element(ConditionExpression.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/RequiredRuleImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/RequiredRuleImpl.java new file mode 100644 index 00000000000..44ec1f4d330 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/RequiredRuleImpl.java @@ -0,0 +1,100 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_CONTEXT_REF; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_NAME; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_REQUIRED_RULE; + +import org.camunda.bpm.model.cmmn.instance.CaseFileItem; +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.cmmn.instance.ConditionExpression; +import org.camunda.bpm.model.cmmn.instance.RequiredRule; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; +import org.camunda.bpm.model.xml.type.reference.AttributeReference; + +/** + * @author Roman Smirnov + * + */ +public class RequiredRuleImpl extends CmmnElementImpl implements RequiredRule { + + protected static Attribute nameAttribute; + protected static AttributeReference contextRefAttribute; + protected static ChildElement conditionChild; + + public RequiredRuleImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getName() { + return nameAttribute.getValue(this); + } + + public void setName(String name) { + nameAttribute.setValue(this, name); + } + + public CaseFileItem getContext() { + return contextRefAttribute.getReferenceTargetElement(this); + } + + public void setContext(CaseFileItem caseFileItem) { + contextRefAttribute.setReferenceTargetElement(this, caseFileItem); + } + + public ConditionExpression getCondition() { + return conditionChild.getChild(this); + } + + public void setCondition(ConditionExpression condition) { + conditionChild.setChild(this, condition); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(RequiredRule.class, CMMN_ELEMENT_REQUIRED_RULE) + .namespaceUri(CMMN11_NS) + .extendsType(CmmnElement.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public RequiredRule newInstance(ModelTypeInstanceContext instanceContext) { + return new RequiredRuleImpl(instanceContext); + } + }); + + nameAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_NAME) + .build(); + + contextRefAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_CONTEXT_REF) + .idAttributeReference(CaseFileItem.class) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + conditionChild = sequenceBuilder.element(ConditionExpression.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/RoleImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/RoleImpl.java new file mode 100644 index 00000000000..def94684235 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/RoleImpl.java @@ -0,0 +1,67 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_NAME; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_ROLE; + +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.cmmn.instance.Role; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; + +/** + * @author Roman Smirnov + * + */ +public class RoleImpl extends CmmnElementImpl implements Role { + + protected static Attribute nameAttribute; + + public RoleImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getName() { + return nameAttribute.getValue(this); + } + + public void setName(String name) { + nameAttribute.setValue(this, name); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Role.class, CMMN_ELEMENT_ROLE) + .extendsType(CmmnElement.class) + .namespaceUri(CMMN11_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public Role newInstance(ModelTypeInstanceContext instanceContext) { + return new RoleImpl(instanceContext); + } + }); + + nameAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_NAME) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/SentryImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/SentryImpl.java new file mode 100644 index 00000000000..874aa3f7b12 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/SentryImpl.java @@ -0,0 +1,96 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_NAME; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_SENTRY; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.cmmn.instance.IfPart; +import org.camunda.bpm.model.cmmn.instance.OnPart; +import org.camunda.bpm.model.cmmn.instance.Sentry; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.ChildElementCollection; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public class SentryImpl extends CmmnElementImpl implements Sentry { + + protected static Attribute nameAttribute; + protected static ChildElementCollection onPartCollection; + protected static ChildElement ifPartChild; + + public SentryImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getName() { + return nameAttribute.getValue(this); + } + + public void setName(String name) { + nameAttribute.setValue(this, name); + } + + public Collection getOnParts() { + return onPartCollection.get(this); + } + + public IfPart getIfPart() { + return ifPartChild.getChild(this); + } + + public void setIfPart(IfPart ifPart) { + ifPartChild.setChild(this, ifPart); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Sentry.class, CMMN_ELEMENT_SENTRY) + .extendsType(CmmnElement.class) + .namespaceUri(CMMN11_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public Sentry newInstance(ModelTypeInstanceContext instanceContext) { + return new SentryImpl(instanceContext); + } + }); + + nameAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_NAME) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + onPartCollection = sequenceBuilder.elementCollection(OnPart.class) + .build(); + + ifPartChild = sequenceBuilder.element(IfPart.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/SourceImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/SourceImpl.java new file mode 100644 index 00000000000..afe6738ed91 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/SourceImpl.java @@ -0,0 +1,50 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_SOURCE; + +import org.camunda.bpm.model.cmmn.instance.Source; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; + +/** + * @author Roman Smirnov + * + */ +public class SourceImpl extends CmmnModelElementInstanceImpl implements Source { + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Source.class, CMMN_ELEMENT_SOURCE) + .namespaceUri(CMMN11_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public Source newInstance(ModelTypeInstanceContext instanceContext) { + return new SourceImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + + public SourceImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/StageImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/StageImpl.java new file mode 100644 index 00000000000..3dab085eaec --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/StageImpl.java @@ -0,0 +1,145 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN10_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_AUTO_COMPLETE; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_EXIT_CRITERIA_REFS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_STAGE; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +import org.camunda.bpm.model.cmmn.instance.ExitCriterion; +import org.camunda.bpm.model.cmmn.instance.PlanFragment; +import org.camunda.bpm.model.cmmn.instance.PlanItemDefinition; +import org.camunda.bpm.model.cmmn.instance.PlanningTable; +import org.camunda.bpm.model.cmmn.instance.Sentry; +import org.camunda.bpm.model.cmmn.instance.Stage; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.ChildElementCollection; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; +import org.camunda.bpm.model.xml.type.reference.AttributeReferenceCollection; + +/** + * @author Roman Smirnov + * + */ +public class StageImpl extends PlanFragmentImpl implements Stage { + + protected static Attribute autoCompleteAttribute; + protected static ChildElement planningTableChild; + protected static ChildElementCollection planItemDefinitionCollection; + + // cmmn 1.0 + @Deprecated + protected static AttributeReferenceCollection exitCriteriaRefCollection; + + // cmmn 1.1 + protected static ChildElementCollection exitCriterionCollection; + + public StageImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public boolean isAutoComplete() { + return autoCompleteAttribute.getValue(this); + } + + public void setAutoComplete(boolean autoComplete) { + autoCompleteAttribute.setValue(this, autoComplete); + } + + public Collection getExitCriterias() { + return exitCriteriaRefCollection.getReferenceTargetElements(this); + } + + public Collection getExitCriteria() { + if (!isCmmn11()) { + return Collections.unmodifiableCollection(getExitCriterias()); + } + else { + List sentries = new ArrayList(); + Collection exitCriterions = getExitCriterions(); + for (ExitCriterion exitCriterion : exitCriterions) { + Sentry sentry = exitCriterion.getSentry(); + if (sentry != null) { + sentries.add(sentry); + } + } + return Collections.unmodifiableCollection(sentries); + } + } + + public Collection getExitCriterions() { + return exitCriterionCollection.get(this); + } + + public PlanningTable getPlanningTable() { + return planningTableChild.getChild(this); + } + + public void setPlanningTable(PlanningTable planningTable) { + planningTableChild.setChild(this, planningTable); + } + + public Collection getPlanItemDefinitions() { + return planItemDefinitionCollection.get(this); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Stage.class, CMMN_ELEMENT_STAGE) + .namespaceUri(CMMN11_NS) + .extendsType(PlanFragment.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public Stage newInstance(ModelTypeInstanceContext instanceContext) { + return new StageImpl(instanceContext); + } + }); + + autoCompleteAttribute = typeBuilder.booleanAttribute(CMMN_ATTRIBUTE_AUTO_COMPLETE) + .defaultValue(false) + .build(); + + exitCriteriaRefCollection = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_EXIT_CRITERIA_REFS) + .namespace(CMMN10_NS) + .idAttributeReferenceCollection(Sentry.class, CmmnAttributeElementReferenceCollection.class) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + planningTableChild = sequenceBuilder.element(PlanningTable.class) + .build(); + + planItemDefinitionCollection = sequenceBuilder.elementCollection(PlanItemDefinition.class) + .build(); + + exitCriterionCollection = sequenceBuilder.elementCollection(ExitCriterion.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/StartTriggerImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/StartTriggerImpl.java new file mode 100644 index 00000000000..057a9f14367 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/StartTriggerImpl.java @@ -0,0 +1,47 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_TIMER_START; + +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.cmmn.instance.StartTrigger; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; + +/** + * @author Roman Smirnov + * + */ +public abstract class StartTriggerImpl extends CmmnElementImpl implements StartTrigger { + + public StartTriggerImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(StartTrigger.class, CMMN_ELEMENT_TIMER_START) + .namespaceUri(CMMN11_NS) + .extendsType(CmmnElement.class) + .abstractType(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TableItemImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TableItemImpl.java new file mode 100644 index 00000000000..94998ca6ab4 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TableItemImpl.java @@ -0,0 +1,73 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_APPLICABILITY_RULE_REFS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_AUTHORIZED_ROLE_REFS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_TABLE_ITEM; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.ApplicabilityRule; +import org.camunda.bpm.model.cmmn.instance.CmmnElement; +import org.camunda.bpm.model.cmmn.instance.Role; +import org.camunda.bpm.model.cmmn.instance.TableItem; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.reference.AttributeReferenceCollection; + +/** + * @author Roman Smirnov + * + */ +public abstract class TableItemImpl extends CmmnElementImpl implements TableItem { + + protected static AttributeReferenceCollection applicabilityRuleRefCollection; + protected static AttributeReferenceCollection authorizedRoleRefCollection; + + public TableItemImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public Collection getApplicabilityRule() { + return applicabilityRuleRefCollection.getReferenceTargetElements(this); + } + + public Collection getAuthorizedRoles() { + return authorizedRoleRefCollection.getReferenceTargetElements(this); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(TableItem.class, CMMN_ELEMENT_TABLE_ITEM) + .namespaceUri(CMMN11_NS) + .abstractType() + .extendsType(CmmnElement.class); + + applicabilityRuleRefCollection = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_APPLICABILITY_RULE_REFS) + .idAttributeReferenceCollection(ApplicabilityRule.class, CmmnAttributeElementReferenceCollection.class) + .build(); + + authorizedRoleRefCollection = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_AUTHORIZED_ROLE_REFS) + .idAttributeReferenceCollection(Role.class, CmmnAttributeElementReferenceCollection.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TargetImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TargetImpl.java new file mode 100644 index 00000000000..6f1723e5a49 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TargetImpl.java @@ -0,0 +1,50 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_TARGET; + +import org.camunda.bpm.model.cmmn.instance.Target; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; + +/** + * @author Roman Smirnov + * + */ +public class TargetImpl extends CmmnModelElementInstanceImpl implements Target { + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Target.class, CMMN_ELEMENT_TARGET) + .namespaceUri(CMMN11_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public Target newInstance(ModelTypeInstanceContext instanceContext) { + return new TargetImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + + public TargetImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TaskImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TaskImpl.java new file mode 100644 index 00000000000..57e368899a6 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TaskImpl.java @@ -0,0 +1,116 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_IS_BLOCKING; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_TASK; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.InputCaseParameter; +import org.camunda.bpm.model.cmmn.instance.InputsCaseParameter; +import org.camunda.bpm.model.cmmn.instance.OutputCaseParameter; +import org.camunda.bpm.model.cmmn.instance.OutputsCaseParameter; +import org.camunda.bpm.model.cmmn.instance.PlanItemDefinition; +import org.camunda.bpm.model.cmmn.instance.Task; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElementCollection; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public class TaskImpl extends PlanItemDefinitionImpl implements Task { + + protected static Attribute isBlockingAttribute; + + // cmmn 1.0 + @Deprecated + protected static ChildElementCollection inputsCollection; + @Deprecated + protected static ChildElementCollection outputsCollection; + + // cmmn 1.1 + protected static ChildElementCollection inputParameterCollection; + protected static ChildElementCollection outputParameterCollection; + + public TaskImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public boolean isBlocking() { + return isBlockingAttribute.getValue(this); + } + + public void setIsBlocking(boolean isBlocking) { + isBlockingAttribute.setValue(this, isBlocking); + } + + public Collection getInputs() { + return inputsCollection.get(this); + } + + public Collection getOutputs() { + return outputsCollection.get(this); + } + + public Collection getInputParameters() { + return inputParameterCollection.get(this); + } + + public Collection getOutputParameters() { + return outputParameterCollection.get(this); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Task.class, CMMN_ELEMENT_TASK) + .namespaceUri(CMMN11_NS) + .extendsType(PlanItemDefinition.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public Task newInstance(ModelTypeInstanceContext instanceContext) { + return new TaskImpl(instanceContext); + } + }); + + isBlockingAttribute = typeBuilder.booleanAttribute(CMMN_ATTRIBUTE_IS_BLOCKING) + .defaultValue(true) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + inputsCollection = sequenceBuilder.elementCollection(InputsCaseParameter.class) + .build(); + + outputsCollection = sequenceBuilder.elementCollection(OutputsCaseParameter.class) + .build(); + + inputParameterCollection = sequenceBuilder.elementCollection(InputCaseParameter.class) + .build(); + + outputParameterCollection = sequenceBuilder.elementCollection(OutputCaseParameter.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TextAnnotationImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TextAnnotationImpl.java new file mode 100644 index 00000000000..cb11ec82054 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TextAnnotationImpl.java @@ -0,0 +1,85 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_TEXT_FORMAT; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_TEXT_ANNOTATION; + +import org.camunda.bpm.model.cmmn.instance.Artifact; +import org.camunda.bpm.model.cmmn.instance.Text; +import org.camunda.bpm.model.cmmn.instance.TextAnnotation; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public class TextAnnotationImpl extends ArtifactImpl implements TextAnnotation { + + protected static Attribute textFormatAttribute; + protected static ChildElement textChild; + + public TextAnnotationImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getTextFormat() { + return textFormatAttribute.getValue(this); + } + + public void setTextFormat(String textFormat) { + textFormatAttribute.setValue(this, textFormat); + } + + public Text getText() { + return textChild.getChild(this); + } + + public void setText(Text text) { + textChild.setChild(this, text); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(TextAnnotation.class, CMMN_ELEMENT_TEXT_ANNOTATION) + .namespaceUri(CMMN11_NS) + .extendsType(Artifact.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public TextAnnotation newInstance(ModelTypeInstanceContext instanceContext) { + return new TextAnnotationImpl(instanceContext); + } + }); + + textFormatAttribute = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_TEXT_FORMAT) + .defaultValue("text/plain") + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + textChild = sequenceBuilder.element(Text.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TextImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TextImpl.java new file mode 100644 index 00000000000..43d68a9d29b --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TextImpl.java @@ -0,0 +1,50 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_TEXT; + +import org.camunda.bpm.model.cmmn.instance.Text; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; + +/** + * @author Roman Smirnov + * + */ +public class TextImpl extends CmmnModelElementInstanceImpl implements Text { + + public TextImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Text.class, CMMN_ELEMENT_TEXT) + .namespaceUri(CMMN11_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public Text newInstance(ModelTypeInstanceContext instanceContext) { + return new TextImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TimerEventImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TimerEventImpl.java new file mode 100644 index 00000000000..c18c5bf14c8 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TimerEventImpl.java @@ -0,0 +1,82 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN10_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_TIMER_EVENT; + +import org.camunda.bpm.model.cmmn.instance.Event; +import org.camunda.bpm.model.cmmn.instance.StartTrigger; +import org.camunda.bpm.model.cmmn.instance.TimerEvent; +import org.camunda.bpm.model.cmmn.instance.TimerExpression; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public class TimerEventImpl extends EventImpl implements TimerEvent { + + protected static ChildElement timerExpressionChild; + protected static ChildElement timerStartChild; + + public TimerEventImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public TimerExpression getTimerExpression() { + return timerExpressionChild.getChild(this); + } + + public void setTimerExpression(TimerExpression timerExpression) { + timerExpressionChild.setChild(this, timerExpression); + } + + public StartTrigger getTimerStart() { + return timerStartChild.getChild(this); + } + + public void setTimerStart(StartTrigger timerStart) { + timerStartChild.setChild(this, timerStart); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(TimerEvent.class, CMMN_ELEMENT_TIMER_EVENT) + .namespaceUri(CMMN10_NS) + .extendsType(Event.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public TimerEvent newInstance(ModelTypeInstanceContext instanceContext) { + return new TimerEventImpl(instanceContext); + } + }); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + timerExpressionChild = sequenceBuilder.element(TimerExpression.class) + .build(); + + timerStartChild = sequenceBuilder.element(StartTrigger.class) + .build(); + + typeBuilder.build(); + } +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TimerEventListenerImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TimerEventListenerImpl.java new file mode 100644 index 00000000000..1c6f4751c11 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TimerEventListenerImpl.java @@ -0,0 +1,83 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_TIMER_EVENT_LISTENER; + +import org.camunda.bpm.model.cmmn.instance.EventListener; +import org.camunda.bpm.model.cmmn.instance.StartTrigger; +import org.camunda.bpm.model.cmmn.instance.TimerEventListener; +import org.camunda.bpm.model.cmmn.instance.TimerExpression; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public class TimerEventListenerImpl extends EventListenerImpl implements TimerEventListener { + + protected static ChildElement timerExpressionChild; + protected static ChildElement timerStartChild; + + public TimerEventListenerImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public TimerExpression getTimerExpression() { + return timerExpressionChild.getChild(this); + } + + public void setTimerExpression(TimerExpression timerExpression) { + timerExpressionChild.setChild(this, timerExpression); + } + + public StartTrigger getTimerStart() { + return timerStartChild.getChild(this); + } + + public void setTimerStart(StartTrigger timerStart) { + timerStartChild.setChild(this, timerStart); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(TimerEventListener.class, CMMN_ELEMENT_TIMER_EVENT_LISTENER) + .namespaceUri(CMMN11_NS) + .extendsType(EventListener.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public TimerEventListener newInstance(ModelTypeInstanceContext instanceContext) { + return new TimerEventListenerImpl(instanceContext); + } + }); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + timerExpressionChild = sequenceBuilder.element(TimerExpression.class) + .build(); + + timerStartChild = sequenceBuilder.element(StartTrigger.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TimerExpressionImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TimerExpressionImpl.java new file mode 100644 index 00000000000..bb0c57a158d --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TimerExpressionImpl.java @@ -0,0 +1,51 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_TIMER_EXPRESSION; + +import org.camunda.bpm.model.cmmn.instance.Expression; +import org.camunda.bpm.model.cmmn.instance.TimerExpression; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; + +/** + * @author Roman Smirnov + * + */ +public class TimerExpressionImpl extends ExpressionImpl implements TimerExpression { + + public TimerExpressionImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(TimerExpression.class, CMMN_ELEMENT_TIMER_EXPRESSION) + .namespaceUri(CMMN11_NS) + .extendsType(Expression.class) + .instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider() { + public TimerExpression newInstance(ModelTypeInstanceContext instanceContext) { + return new TimerExpressionImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TransformationExpressionImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TransformationExpressionImpl.java new file mode 100644 index 00000000000..61accf55e16 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/TransformationExpressionImpl.java @@ -0,0 +1,51 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_TRANSFORMATION; + +import org.camunda.bpm.model.cmmn.instance.Expression; +import org.camunda.bpm.model.cmmn.instance.TransformationExpression; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; + +/** + * @author Roman Smirnov + * + */ +public class TransformationExpressionImpl extends ExpressionImpl implements TransformationExpression { + + public TransformationExpressionImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(TransformationExpression.class, CMMN_ELEMENT_TRANSFORMATION) + .namespaceUri(CMMN11_NS) + .extendsType(Expression.class) + .instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider() { + public TransformationExpression newInstance(ModelTypeInstanceContext instanceContext) { + return new TransformationExpressionImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/UserEventImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/UserEventImpl.java new file mode 100644 index 00000000000..431bcbb4858 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/UserEventImpl.java @@ -0,0 +1,52 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN10_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_USER_EVENT; + +import org.camunda.bpm.model.cmmn.instance.Event; +import org.camunda.bpm.model.cmmn.instance.UserEvent; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; + +/** + * @author Roman Smirnov + * + */ +public class UserEventImpl extends EventImpl implements UserEvent { + + public UserEventImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(UserEvent.class, CMMN_ELEMENT_USER_EVENT) + .namespaceUri(CMMN10_NS) + .extendsType(Event.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public UserEvent newInstance(ModelTypeInstanceContext instanceContext) { + return new UserEventImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/UserEventListenerImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/UserEventListenerImpl.java new file mode 100644 index 00000000000..6b6770a85a9 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/UserEventListenerImpl.java @@ -0,0 +1,68 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ATTRIBUTE_AUTHORIZED_ROLE_REFS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN_ELEMENT_USER_EVENT_LISTENER; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.EventListener; +import org.camunda.bpm.model.cmmn.instance.Role; +import org.camunda.bpm.model.cmmn.instance.UserEventListener; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.reference.AttributeReferenceCollection; + +/** + * @author Roman Smirnov + * + */ +public class UserEventListenerImpl extends EventListenerImpl implements UserEventListener { + + protected static AttributeReferenceCollection authorizedRoleRefCollection; + + public UserEventListenerImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public Collection getAuthorizedRoles() { + return authorizedRoleRefCollection.getReferenceTargetElements(this); + } + + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(UserEventListener.class, CMMN_ELEMENT_USER_EVENT_LISTENER) + .namespaceUri(CMMN11_NS) + .extendsType(EventListener.class) + .instanceProvider(new ModelTypeInstanceProvider() { + public UserEventListener newInstance(ModelTypeInstanceContext instanceContext) { + return new UserEventListenerImpl(instanceContext); + } + }); + + authorizedRoleRefCollection = typeBuilder.stringAttribute(CMMN_ATTRIBUTE_AUTHORIZED_ROLE_REFS) + .idAttributeReferenceCollection(Role.class, CmmnAttributeElementReferenceCollection.class) + .build(); + + typeBuilder.build(); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaCaseExecutionListenerImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaCaseExecutionListenerImpl.java new file mode 100644 index 00000000000..0983089e9e8 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaCaseExecutionListenerImpl.java @@ -0,0 +1,138 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance.camunda; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_CLASS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_DELEGATE_EXPRESSION; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_EVENT; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_EXPRESSION; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ELEMENT_CASE_EXECUTION_LISTENER; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.impl.instance.CmmnModelElementInstanceImpl; +import org.camunda.bpm.model.cmmn.instance.camunda.CamundaCaseExecutionListener; +import org.camunda.bpm.model.cmmn.instance.camunda.CamundaField; +import org.camunda.bpm.model.cmmn.instance.camunda.CamundaScript; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.ChildElementCollection; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public class CamundaCaseExecutionListenerImpl extends CmmnModelElementInstanceImpl implements CamundaCaseExecutionListener { + + protected static Attribute camundaEventAttribute; + protected static Attribute camundaClassAttribute; + protected static Attribute camundaExpressionAttribute; + protected static Attribute camundaDelegateExpressionAttribute; + protected static ChildElementCollection camundaFieldCollection; + protected static ChildElement camundaScriptChild; + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CamundaCaseExecutionListener.class, CAMUNDA_ELEMENT_CASE_EXECUTION_LISTENER) + .namespaceUri(CAMUNDA_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public CamundaCaseExecutionListener newInstance(ModelTypeInstanceContext instanceContext) { + return new CamundaCaseExecutionListenerImpl(instanceContext); + } + }); + + camundaEventAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_EVENT) + .namespace(CAMUNDA_NS) + .build(); + + camundaClassAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_CLASS) + .namespace(CAMUNDA_NS) + .build(); + + camundaExpressionAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_EXPRESSION) + .namespace(CAMUNDA_NS) + .build(); + + camundaDelegateExpressionAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_DELEGATE_EXPRESSION) + .namespace(CAMUNDA_NS) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + camundaFieldCollection = sequenceBuilder.elementCollection(CamundaField.class) + .build(); + + camundaScriptChild = sequenceBuilder.element(CamundaScript.class) + .build(); + + typeBuilder.build(); + } + + public CamundaCaseExecutionListenerImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getCamundaEvent() { + return camundaEventAttribute.getValue(this); + } + + public void setCamundaEvent(String camundaEvent) { + camundaEventAttribute.setValue(this, camundaEvent); + } + + public String getCamundaClass() { + return camundaClassAttribute.getValue(this); + } + + public void setCamundaClass(String camundaClass) { + camundaClassAttribute.setValue(this, camundaClass); + } + + public String getCamundaExpression() { + return camundaExpressionAttribute.getValue(this); + } + + public void setCamundaExpression(String camundaExpression) { + camundaExpressionAttribute.setValue(this, camundaExpression); + } + + public String getCamundaDelegateExpression() { + return camundaDelegateExpressionAttribute.getValue(this); + } + + public void setCamundaDelegateExpression(String camundaDelegateExpression) { + camundaDelegateExpressionAttribute.setValue(this, camundaDelegateExpression); + } + + public CamundaScript getCamundaScript() { + return camundaScriptChild.getChild(this); + } + + public void setCamundaScript(CamundaScript camundaScript) { + camundaScriptChild.setChild(this, camundaScript); + } + + public Collection getCamundaFields() { + return camundaFieldCollection.get(this); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaExpressionImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaExpressionImpl.java new file mode 100644 index 00000000000..c9fad9cf13a --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaExpressionImpl.java @@ -0,0 +1,51 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance.camunda; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ELEMENT_EXPRESSION; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; + +import org.camunda.bpm.model.cmmn.impl.instance.CmmnModelElementInstanceImpl; +import org.camunda.bpm.model.cmmn.instance.camunda.CamundaExpression; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; + +/** + * @author Roman Smirnov + * + */ +public class CamundaExpressionImpl extends CmmnModelElementInstanceImpl implements CamundaExpression { + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CamundaExpression.class, CAMUNDA_ELEMENT_EXPRESSION) + .namespaceUri(CAMUNDA_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public CamundaExpression newInstance(ModelTypeInstanceContext instanceContext) { + return new CamundaExpressionImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + + public CamundaExpressionImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaFieldImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaFieldImpl.java new file mode 100644 index 00000000000..a88a58df231 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaFieldImpl.java @@ -0,0 +1,125 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance.camunda; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_EXPRESSION; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_NAME; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_STRING_VALUE; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ELEMENT_FIELD; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; + +import org.camunda.bpm.model.cmmn.impl.instance.CmmnModelElementInstanceImpl; +import org.camunda.bpm.model.cmmn.instance.camunda.CamundaExpression; +import org.camunda.bpm.model.cmmn.instance.camunda.CamundaField; +import org.camunda.bpm.model.cmmn.instance.camunda.CamundaString; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public class CamundaFieldImpl extends CmmnModelElementInstanceImpl implements CamundaField { + + protected static Attribute camundaNameAttribute; + protected static Attribute camundaExpressionAttribute; + protected static Attribute camundaStringValueAttribute; + protected static ChildElement camundaExpressionChild; + protected static ChildElement camundaStringChild; + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CamundaField.class, CAMUNDA_ELEMENT_FIELD) + .namespaceUri(CAMUNDA_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public CamundaField newInstance(ModelTypeInstanceContext instanceContext) { + return new CamundaFieldImpl(instanceContext); + } + }); + + camundaNameAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_NAME) + .namespace(CAMUNDA_NS) + .build(); + + camundaExpressionAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_EXPRESSION) + .namespace(CAMUNDA_NS) + .build(); + + camundaStringValueAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_STRING_VALUE) + .namespace(CAMUNDA_NS) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + camundaExpressionChild = sequenceBuilder.element(CamundaExpression.class) + .build(); + + camundaStringChild = sequenceBuilder.element(CamundaString.class) + .build(); + + typeBuilder.build(); + } + + public CamundaFieldImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getCamundaName() { + return camundaNameAttribute.getValue(this); + } + + public void setCamundaName(String camundaName) { + camundaNameAttribute.setValue(this, camundaName); + } + + public String getCamundaExpression() { + return camundaExpressionAttribute.getValue(this); + } + + public void setCamundaExpression(String camundaExpression) { + camundaExpressionAttribute.setValue(this, camundaExpression); + } + + public String getCamundaStringValue() { + return camundaStringValueAttribute.getValue(this); + } + + public void setCamundaStringValue(String camundaStringValue) { + camundaStringValueAttribute.setValue(this, camundaStringValue); + } + + public CamundaString getCamundaString() { + return camundaStringChild.getChild(this); + } + + public void setCamundaString(CamundaString camundaString) { + camundaStringChild.setChild(this, camundaString); + } + + public CamundaExpression getCamundaExpressionChild() { + return camundaExpressionChild.getChild(this); + } + + public void setCamundaExpressionChild(CamundaExpression camundaExpression) { + camundaExpressionChild.setChild(this, camundaExpression); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaInImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaInImpl.java new file mode 100644 index 00000000000..09b1d754bf7 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaInImpl.java @@ -0,0 +1,138 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance.camunda; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_BUSINESS_KEY; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_LOCAL; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_SOURCE; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_SOURCE_EXPRESSION; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_TARGET; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_VARIABLES; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ELEMENT_IN; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; + +import org.camunda.bpm.model.cmmn.impl.instance.CmmnModelElementInstanceImpl; +import org.camunda.bpm.model.cmmn.instance.camunda.CamundaIn; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; + +/** + * @author Sebastian Menski + * @author Roman Smirnov + * + */ +public class CamundaInImpl extends CmmnModelElementInstanceImpl implements CamundaIn { + + protected static Attribute camundaSourceAttribute; + protected static Attribute camundaSourceExpressionAttribute; + protected static Attribute camundaVariablesAttribute; + protected static Attribute camundaTargetAttribute; + protected static Attribute camundaBusinessKeyAttribute; + protected static Attribute camundaLocalAttribute; + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CamundaIn.class, CAMUNDA_ELEMENT_IN) + .namespaceUri(CAMUNDA_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public CamundaIn newInstance(ModelTypeInstanceContext instanceContext) { + return new CamundaInImpl(instanceContext); + } + }); + + camundaSourceAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_SOURCE) + .namespace(CAMUNDA_NS) + .build(); + + camundaSourceExpressionAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_SOURCE_EXPRESSION) + .namespace(CAMUNDA_NS) + .build(); + + camundaVariablesAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_VARIABLES) + .namespace(CAMUNDA_NS) + .build(); + + camundaTargetAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_TARGET) + .namespace(CAMUNDA_NS) + .build(); + + camundaBusinessKeyAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_BUSINESS_KEY) + .namespace(CAMUNDA_NS) + .build(); + + camundaLocalAttribute = typeBuilder.booleanAttribute(CAMUNDA_ATTRIBUTE_LOCAL) + .namespace(CAMUNDA_NS) + .build(); + + typeBuilder.build(); + } + + public CamundaInImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getCamundaSource() { + return camundaSourceAttribute.getValue(this); + } + + public void setCamundaSource(String camundaSource) { + camundaSourceAttribute.setValue(this, camundaSource); + } + + public String getCamundaSourceExpression() { + return camundaSourceExpressionAttribute.getValue(this); + } + + public void setCamundaSourceExpression(String camundaSourceExpression) { + camundaSourceExpressionAttribute.setValue(this, camundaSourceExpression); + } + + public String getCamundaVariables() { + return camundaVariablesAttribute.getValue(this); + } + + public void setCamundaVariables(String camundaVariables) { + camundaVariablesAttribute.setValue(this, camundaVariables); + } + + public String getCamundaTarget() { + return camundaTargetAttribute.getValue(this); + } + + public void setCamundaTarget(String camundaTarget) { + camundaTargetAttribute.setValue(this, camundaTarget); + } + + public String getCamundaBusinessKey() { + return camundaBusinessKeyAttribute.getValue(this); + } + + public void setCamundaBusinessKey(String camundaBusinessKey) { + camundaBusinessKeyAttribute.setValue(this, camundaBusinessKey); + } + + public boolean getCamundaLocal() { + return camundaLocalAttribute.getValue(this); + } + + public void setCamundaLocal(boolean local) { + camundaLocalAttribute.setValue(this, local); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaOutImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaOutImpl.java new file mode 100644 index 00000000000..d5e706ef1ec --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaOutImpl.java @@ -0,0 +1,110 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance.camunda; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_SOURCE; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_SOURCE_EXPRESSION; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_TARGET; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_VARIABLES; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ELEMENT_OUT; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; + +import org.camunda.bpm.model.cmmn.impl.instance.CmmnModelElementInstanceImpl; +import org.camunda.bpm.model.cmmn.instance.camunda.CamundaOut; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; + +/** + * @author Sebastian Menski + * @author Roman Smirnov + * + */ +public class CamundaOutImpl extends CmmnModelElementInstanceImpl implements CamundaOut { + + protected static Attribute camundaSourceAttribute; + protected static Attribute camundaSourceExpressionAttribute; + protected static Attribute camundaVariablesAttribute; + protected static Attribute camundaTargetAttribute; + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CamundaOut.class, CAMUNDA_ELEMENT_OUT) + .namespaceUri(CAMUNDA_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public CamundaOut newInstance(ModelTypeInstanceContext instanceContext) { + return new CamundaOutImpl(instanceContext); + } + }); + + camundaSourceAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_SOURCE) + .namespace(CAMUNDA_NS) + .build(); + + camundaSourceExpressionAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_SOURCE_EXPRESSION) + .namespace(CAMUNDA_NS) + .build(); + + camundaVariablesAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_VARIABLES) + .namespace(CAMUNDA_NS) + .build(); + + camundaTargetAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_TARGET) + .namespace(CAMUNDA_NS) + .build(); + + typeBuilder.build(); + } + + public CamundaOutImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getCamundaSource() { + return camundaSourceAttribute.getValue(this); + } + + public void setCamundaSource(String camundaSource) { + camundaSourceAttribute.setValue(this, camundaSource); + } + + public String getCamundaSourceExpression() { + return camundaSourceExpressionAttribute.getValue(this); + } + + public void setCamundaSourceExpression(String camundaSourceExpression) { + camundaSourceExpressionAttribute.setValue(this, camundaSourceExpression); + } + + public String getCamundaVariables() { + return camundaVariablesAttribute.getValue(this); + } + + public void setCamundaVariables(String camundaVariables) { + camundaVariablesAttribute.setValue(this, camundaVariables); + } + + public String getCamundaTarget() { + return camundaTargetAttribute.getValue(this); + } + + public void setCamundaTarget(String camundaTarget) { + camundaTargetAttribute.setValue(this, camundaTarget); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaScriptImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaScriptImpl.java new file mode 100644 index 00000000000..0007910ca26 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaScriptImpl.java @@ -0,0 +1,81 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance.camunda; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_RESOURCE; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_SCRIPT_FORMAT; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ELEMENT_SCRIPT; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; + +import org.camunda.bpm.model.cmmn.impl.instance.CmmnModelElementInstanceImpl; +import org.camunda.bpm.model.cmmn.instance.camunda.CamundaScript; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; + +/** + * @author Roman Smirnov + * + */ +public class CamundaScriptImpl extends CmmnModelElementInstanceImpl implements CamundaScript { + + protected static Attribute camundaScriptFormatAttribute; + protected static Attribute camundaResourceAttribute; + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CamundaScript.class, CAMUNDA_ELEMENT_SCRIPT) + .namespaceUri(CAMUNDA_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public CamundaScript newInstance(ModelTypeInstanceContext instanceContext) { + return new CamundaScriptImpl(instanceContext); + } + }); + + camundaScriptFormatAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_SCRIPT_FORMAT) + .namespace(CAMUNDA_NS) + .build(); + + camundaResourceAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_RESOURCE) + .namespace(CAMUNDA_NS) + .build(); + + typeBuilder.build(); + } + + public CamundaScriptImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getCamundaScriptFormat() { + return camundaScriptFormatAttribute.getValue(this); + } + + public void setCamundaScriptFormat(String scriptFormat) { + camundaScriptFormatAttribute.setValue(this, scriptFormat); + } + + public String getCamundaResource() { + return camundaResourceAttribute.getValue(this); + } + + public void setCamundaResoure(String resource) { + camundaResourceAttribute.setValue(this, resource); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaStringImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaStringImpl.java new file mode 100644 index 00000000000..5846f7a6757 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaStringImpl.java @@ -0,0 +1,51 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance.camunda; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ELEMENT_STRING; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; + +import org.camunda.bpm.model.cmmn.impl.instance.CmmnModelElementInstanceImpl; +import org.camunda.bpm.model.cmmn.instance.camunda.CamundaString; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; + +/** + * @author Roman Smirnov + * + */ +public class CamundaStringImpl extends CmmnModelElementInstanceImpl implements CamundaString { + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CamundaString.class, CAMUNDA_ELEMENT_STRING) + .namespaceUri(CAMUNDA_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public CamundaString newInstance(ModelTypeInstanceContext instanceContext) { + return new CamundaStringImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + + public CamundaStringImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaTaskListenerImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaTaskListenerImpl.java new file mode 100644 index 00000000000..34f5390b9e7 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaTaskListenerImpl.java @@ -0,0 +1,138 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance.camunda; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_CLASS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_DELEGATE_EXPRESSION; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_EVENT; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_EXPRESSION; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ELEMENT_TASK_LISTENER; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.impl.instance.CmmnModelElementInstanceImpl; +import org.camunda.bpm.model.cmmn.instance.camunda.CamundaField; +import org.camunda.bpm.model.cmmn.instance.camunda.CamundaScript; +import org.camunda.bpm.model.cmmn.instance.camunda.CamundaTaskListener; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.ChildElementCollection; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Roman Smirnov + * + */ +public class CamundaTaskListenerImpl extends CmmnModelElementInstanceImpl implements CamundaTaskListener { + + protected static Attribute camundaEventAttribute; + protected static Attribute camundaClassAttribute; + protected static Attribute camundaExpressionAttribute; + protected static Attribute camundaDelegateExpressionAttribute; + protected static ChildElementCollection camundaFieldCollection; + protected static ChildElement camundaScriptChild; + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CamundaTaskListener.class, CAMUNDA_ELEMENT_TASK_LISTENER) + .namespaceUri(CAMUNDA_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public CamundaTaskListener newInstance(ModelTypeInstanceContext instanceContext) { + return new CamundaTaskListenerImpl(instanceContext); + } + }); + + camundaEventAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_EVENT) + .namespace(CAMUNDA_NS) + .build(); + + camundaClassAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_CLASS) + .namespace(CAMUNDA_NS) + .build(); + + camundaExpressionAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_EXPRESSION) + .namespace(CAMUNDA_NS) + .build(); + + camundaDelegateExpressionAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_DELEGATE_EXPRESSION) + .namespace(CAMUNDA_NS) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + camundaFieldCollection = sequenceBuilder.elementCollection(CamundaField.class) + .build(); + + camundaScriptChild = sequenceBuilder.element(CamundaScript.class) + .build(); + + typeBuilder.build(); + } + + public CamundaTaskListenerImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public String getCamundaEvent() { + return camundaEventAttribute.getValue(this); + } + + public void setCamundaEvent(String camundaEvent) { + camundaEventAttribute.setValue(this, camundaEvent); + } + + public String getCamundaClass() { + return camundaClassAttribute.getValue(this); + } + + public void setCamundaClass(String camundaClass) { + camundaClassAttribute.setValue(this, camundaClass); + } + + public String getCamundaExpression() { + return camundaExpressionAttribute.getValue(this); + } + + public void setCamundaExpression(String camundaExpression) { + camundaExpressionAttribute.setValue(this, camundaExpression); + } + + public String getCamundaDelegateExpression() { + return camundaDelegateExpressionAttribute.getValue(this); + } + + public void setCamundaDelegateExpression(String camundaDelegateExpression) { + camundaDelegateExpressionAttribute.setValue(this, camundaDelegateExpression); + } + + public CamundaScript getCamundaScript() { + return camundaScriptChild.getChild(this); + } + + public void setCamundaScript(CamundaScript camundaScript) { + camundaScriptChild.setChild(this, camundaScript); + } + + public Collection getCamundaFields() { + return camundaFieldCollection.get(this); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaVariableListenerImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaVariableListenerImpl.java new file mode 100644 index 00000000000..3eef33e35c2 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaVariableListenerImpl.java @@ -0,0 +1,136 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance.camunda; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_CLASS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_DELEGATE_EXPRESSION; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_EVENT; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_EXPRESSION; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ELEMENT_VARIABLE_LISTENER; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.impl.instance.CmmnModelElementInstanceImpl; +import org.camunda.bpm.model.cmmn.instance.camunda.CamundaField; +import org.camunda.bpm.model.cmmn.instance.camunda.CamundaScript; +import org.camunda.bpm.model.cmmn.instance.camunda.CamundaVariableListener; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.ChildElementCollection; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +/** + * @author Thorben Lindhauer + */ +public class CamundaVariableListenerImpl extends CmmnModelElementInstanceImpl implements CamundaVariableListener { + + protected static Attribute camundaEventAttribute; + protected static Attribute camundaClassAttribute; + protected static Attribute camundaExpressionAttribute; + protected static Attribute camundaDelegateExpressionAttribute; + protected static ChildElementCollection camundaFieldCollection; + protected static ChildElement camundaScriptChild; + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CamundaVariableListener.class, CAMUNDA_ELEMENT_VARIABLE_LISTENER) + .namespaceUri(CAMUNDA_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public CamundaVariableListener newInstance(ModelTypeInstanceContext instanceContext) { + return new CamundaVariableListenerImpl(instanceContext); + } + }); + + camundaEventAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_EVENT) + .namespace(CAMUNDA_NS) + .build(); + + camundaClassAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_CLASS) + .namespace(CAMUNDA_NS) + .build(); + + camundaExpressionAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_EXPRESSION) + .namespace(CAMUNDA_NS) + .build(); + + camundaDelegateExpressionAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_DELEGATE_EXPRESSION) + .namespace(CAMUNDA_NS) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + camundaFieldCollection = sequenceBuilder.elementCollection(CamundaField.class) + .build(); + + camundaScriptChild = sequenceBuilder.element(CamundaScript.class) + .build(); + + typeBuilder.build(); + } + + public CamundaVariableListenerImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + public String getCamundaEvent() { + return camundaEventAttribute.getValue(this); + } + + public void setCamundaEvent(String camundaEvent) { + camundaEventAttribute.setValue(this, camundaEvent); + } + + public String getCamundaClass() { + return camundaClassAttribute.getValue(this); + } + + public void setCamundaClass(String camundaClass) { + camundaClassAttribute.setValue(this, camundaClass); + } + + public String getCamundaExpression() { + return camundaExpressionAttribute.getValue(this); + } + + public void setCamundaExpression(String camundaExpression) { + camundaExpressionAttribute.setValue(this, camundaExpression); + } + + public String getCamundaDelegateExpression() { + return camundaDelegateExpressionAttribute.getValue(this); + } + + public void setCamundaDelegateExpression(String camundaDelegateExpression) { + camundaDelegateExpressionAttribute.setValue(this, camundaDelegateExpression); + } + + public CamundaScript getCamundaScript() { + return camundaScriptChild.getChild(this); + } + + public void setCamundaScript(CamundaScript camundaScript) { + camundaScriptChild.setChild(this, camundaScript); + } + + public Collection getCamundaFields() { + return camundaFieldCollection.get(this); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaVariableOnPartImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaVariableOnPartImpl.java new file mode 100644 index 00000000000..d4664230681 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaVariableOnPartImpl.java @@ -0,0 +1,85 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance.camunda; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ATTRIBUTE_VARIABLE_NAME; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ELEMENT_VARIABLE_ON_PART; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; + +import org.camunda.bpm.model.cmmn.VariableTransition; +import org.camunda.bpm.model.cmmn.impl.instance.CmmnModelElementInstanceImpl; +import org.camunda.bpm.model.cmmn.instance.camunda.CamundaVariableOnPart; +import org.camunda.bpm.model.cmmn.instance.camunda.CamundaVariableTransitionEvent; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; +import org.camunda.bpm.model.xml.type.attribute.Attribute; +import org.camunda.bpm.model.xml.type.child.ChildElement; +import org.camunda.bpm.model.xml.type.child.SequenceBuilder; + +public class CamundaVariableOnPartImpl extends CmmnModelElementInstanceImpl implements CamundaVariableOnPart { + + protected static Attribute camundaVariableNameAttribute; + protected static ChildElement camundaVariableEventChild; + + public CamundaVariableOnPartImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CamundaVariableOnPart.class, CAMUNDA_ELEMENT_VARIABLE_ON_PART) + .namespaceUri(CAMUNDA_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public CamundaVariableOnPart newInstance(ModelTypeInstanceContext instanceContext) { + return new CamundaVariableOnPartImpl(instanceContext); + } + }); + + camundaVariableNameAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_VARIABLE_NAME) + .namespace(CAMUNDA_NS) + .build(); + + SequenceBuilder sequenceBuilder = typeBuilder.sequence(); + + camundaVariableEventChild = sequenceBuilder.element(CamundaVariableTransitionEvent.class) + .build(); + + typeBuilder.build(); + } + + public String getVariableName() { + return camundaVariableNameAttribute.getValue(this); + } + + public void setVariableName(String name) { + camundaVariableNameAttribute.setValue(this, name); + } + + + public VariableTransition getVariableEvent() { + CamundaVariableTransitionEvent child = camundaVariableEventChild.getChild(this); + return child.getValue(); + } + + public void setVariableEvent(VariableTransition variableTransition) { + CamundaVariableTransitionEvent child = camundaVariableEventChild.getChild(this); + child.setValue(variableTransition); + } + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaVariableTransitionEventImpl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaVariableTransitionEventImpl.java new file mode 100644 index 00000000000..156820128ad --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/impl/instance/camunda/CamundaVariableTransitionEventImpl.java @@ -0,0 +1,56 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.impl.instance.camunda; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_ELEMENT_VARIABLE_EVENT; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; + +import org.camunda.bpm.model.cmmn.VariableTransition; +import org.camunda.bpm.model.cmmn.impl.instance.CmmnModelElementInstanceImpl; +import org.camunda.bpm.model.cmmn.instance.camunda.CamundaVariableTransitionEvent; +import org.camunda.bpm.model.xml.ModelBuilder; +import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder; +import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider; + +public class CamundaVariableTransitionEventImpl extends CmmnModelElementInstanceImpl implements CamundaVariableTransitionEvent { + + public CamundaVariableTransitionEventImpl(ModelTypeInstanceContext instanceContext) { + super(instanceContext); + } + + public static void registerType(ModelBuilder modelBuilder) { + ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(CamundaVariableTransitionEvent.class, CAMUNDA_ELEMENT_VARIABLE_EVENT) + .namespaceUri(CAMUNDA_NS) + .instanceProvider(new ModelTypeInstanceProvider() { + public CamundaVariableTransitionEvent newInstance(ModelTypeInstanceContext instanceContext) { + return new CamundaVariableTransitionEventImpl(instanceContext); + } + }); + + typeBuilder.build(); + } + + public VariableTransition getValue() { + String variableEvent = getTextContent().trim(); + return Enum.valueOf(VariableTransition.class, variableEvent); + } + + public void setValue(VariableTransition value) { + setTextContent(value.toString()); + } +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ApplicabilityRule.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ApplicabilityRule.java new file mode 100644 index 00000000000..e33d26ba2f6 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ApplicabilityRule.java @@ -0,0 +1,38 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + + +/** + * @author Roman Smirnov + * + */ +public interface ApplicabilityRule extends CmmnElement { + + String getName(); + + void setName(String name); + + CaseFileItem getContext(); + + void setContext(CaseFileItem context); + + ConditionExpression getCondition(); + + void setCondition(ConditionExpression expression); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Artifact.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Artifact.java new file mode 100644 index 00000000000..7162341c218 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Artifact.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface Artifact extends CmmnElement { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Association.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Association.java new file mode 100644 index 00000000000..ec1c3b29b68 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Association.java @@ -0,0 +1,40 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import org.camunda.bpm.model.cmmn.AssociationDirection; + + +/** + * @author Roman Smirnov + * + */ +public interface Association extends Artifact { + + CmmnElement getSource(); + + void setSource(CmmnElement cmmnElement); + + CmmnElement getTarget(); + + void setTarget(CmmnElement cmmnElement); + + AssociationDirection getAssociationDirection(); + + void setAssociationDirection(AssociationDirection associationDirection); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/BindingRefinementExpression.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/BindingRefinementExpression.java new file mode 100644 index 00000000000..ab1195cc2d8 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/BindingRefinementExpression.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface BindingRefinementExpression extends Expression { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Body.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Body.java new file mode 100644 index 00000000000..2bd52e10f82 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Body.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface Body extends CmmnModelElementInstance { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Case.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Case.java new file mode 100644 index 00000000000..13d03a60f67 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Case.java @@ -0,0 +1,59 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public interface Case extends CmmnElement { + + String getName(); + + void setName(String name); + + @Deprecated + Collection getCaseRoles(); + + CaseRoles getRoles(); + + void setRoles(CaseRoles roles); + + Collection getInputs(); + + Collection getOutputs(); + + CasePlanModel getCasePlanModel(); + + void setCasePlanModel(CasePlanModel casePlanModel); + + CaseFileModel getCaseFileModel(); + + void setCaseFileModel(CaseFileModel caseFileModel); + + @Deprecated + Integer getCamundaHistoryTimeToLive(); + + @Deprecated + void setCamundaHistoryTimeToLive(Integer historyTimeToLive); + + String getCamundaHistoryTimeToLiveString(); + + void setCamundaHistoryTimeToLiveString(String historyTimeToLive); +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseFile.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseFile.java new file mode 100644 index 00000000000..317431dad06 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseFile.java @@ -0,0 +1,29 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public interface CaseFile extends CmmnElement { + + Collection getCaseFileItems(); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseFileItem.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseFileItem.java new file mode 100644 index 00000000000..7d6058e1f94 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseFileItem.java @@ -0,0 +1,55 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.MultiplicityEnum; + +/** + * @author Roman Smirnov + * + */ +public interface CaseFileItem extends CmmnElement { + + String getName(); + + void setName(String name); + + Children getChildren(); + + void setChildren(Children children); + + MultiplicityEnum getMultiplicity(); + + void setMultiplicity(MultiplicityEnum multiplicity); + + CaseFileItemDefinition getDefinitionRef(); + + void setDefinitionRef(CaseFileItemDefinition caseFileItemDefinition); + + @Deprecated + CaseFileItem getSourceRef(); + + @Deprecated + void setSourceRef(CaseFileItem sourceRef); + + Collection getSourceRefs(); + + Collection getTargetRefs(); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemDefinition.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemDefinition.java new file mode 100644 index 00000000000..b6415d16cec --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemDefinition.java @@ -0,0 +1,41 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public interface CaseFileItemDefinition extends CmmnElement { + + String getName(); + + void setName(String name); + + String getDefinitionType(); + + void setDefinitionType(String definitionType); + + String getStructure(); + + void setStructure(String structureRef); + + Collection getProperties(); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemOnPart.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemOnPart.java new file mode 100644 index 00000000000..2f11ceb1275 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemOnPart.java @@ -0,0 +1,35 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import org.camunda.bpm.model.cmmn.CaseFileItemTransition; + +/** + * @author Roman Smirnov + * + */ +public interface CaseFileItemOnPart extends OnPart { + + CaseFileItem getSource(); + + void setSource(CaseFileItem source); + + CaseFileItemTransition getStandardEvent(); + + void setStandardEvent(CaseFileItemTransition standardEvent); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemStartTrigger.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemStartTrigger.java new file mode 100644 index 00000000000..ed90d7c2495 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemStartTrigger.java @@ -0,0 +1,35 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import org.camunda.bpm.model.cmmn.CaseFileItemTransition; + +/** + * @author Roman Smirnov + * + */ +public interface CaseFileItemStartTrigger extends StartTrigger { + + CaseFileItem getSource(); + + void setSource(CaseFileItem source); + + CaseFileItemTransition getStandardEvent(); + + void setStandardEvent(CaseFileItemTransition standardEvent); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemTransitionStandardEvent.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemTransitionStandardEvent.java new file mode 100644 index 00000000000..8f30080f174 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemTransitionStandardEvent.java @@ -0,0 +1,27 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import org.camunda.bpm.model.cmmn.CaseFileItemTransition; + +public interface CaseFileItemTransitionStandardEvent extends CmmnModelElementInstance { + + CaseFileItemTransition getValue(); + + void setValue(CaseFileItemTransition value); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseFileModel.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseFileModel.java new file mode 100644 index 00000000000..42faa95211a --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseFileModel.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface CaseFileModel extends CaseFile { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseParameter.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseParameter.java new file mode 100644 index 00000000000..3c0a0588b30 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseParameter.java @@ -0,0 +1,33 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface CaseParameter extends Parameter { + + CaseFileItem getBinding(); + + void setBinding(CaseFileItem bindingRef); + + BindingRefinementExpression getBindingRefinement(); + + void setBindingRefinement(BindingRefinementExpression bindingRefinement); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CasePlanModel.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CasePlanModel.java new file mode 100644 index 00000000000..259e19cc904 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CasePlanModel.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface CasePlanModel extends Stage { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseRefExpression.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseRefExpression.java new file mode 100644 index 00000000000..5cdea863aac --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseRefExpression.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface CaseRefExpression extends Expression { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseRole.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseRole.java new file mode 100644 index 00000000000..117349dc1ed --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseRole.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface CaseRole extends Role { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseRoles.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseRoles.java new file mode 100644 index 00000000000..faace275ca7 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseRoles.java @@ -0,0 +1,29 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public interface CaseRoles extends CmmnElement { + + Collection getRoles(); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseTask.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseTask.java new file mode 100644 index 00000000000..501d6c3215a --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CaseTask.java @@ -0,0 +1,51 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public interface CaseTask extends Task { + + String getCase(); + + void setCase(String caseInstance); + + CaseRefExpression getCaseExpression(); + + void setCaseExpression(CaseRefExpression caseExpression); + + Collection getParameterMappings(); + + /** camunda extensions */ + + String getCamundaCaseBinding(); + + void setCamundaCaseBinding(String camundaCaseBinding); + + String getCamundaCaseVersion(); + + void setCamundaCaseVersion(String camundaCaseVersion); + + String getCamundaCaseTenantId(); + + void setCamundaCaseTenantId(String camundaCaseTenantId); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Children.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Children.java new file mode 100644 index 00000000000..4e8de1d02ac --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Children.java @@ -0,0 +1,29 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public interface Children extends CmmnElement { + + Collection getCaseFileItems(); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CmmnElement.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CmmnElement.java new file mode 100644 index 00000000000..9d93f63e13b --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CmmnElement.java @@ -0,0 +1,43 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public interface CmmnElement extends CmmnModelElementInstance { + + String getId(); + + void setId(String id); + + @Deprecated + String getDescription(); + + @Deprecated + void setDescription(String description); + + Collection getDocumentations(); + + ExtensionElements getExtensionElements(); + + void setExtensionElements(ExtensionElements extensionElements); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CmmnModelElementInstance.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CmmnModelElementInstance.java new file mode 100644 index 00000000000..c060333c728 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/CmmnModelElementInstance.java @@ -0,0 +1,27 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import org.camunda.bpm.model.xml.instance.ModelElementInstance; + +/** + * @author Roman Smirnov + * + */ +public interface CmmnModelElementInstance extends ModelElementInstance { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ConditionExpression.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ConditionExpression.java new file mode 100644 index 00000000000..d0c0bba4ba6 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ConditionExpression.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface ConditionExpression extends Expression { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Criterion.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Criterion.java new file mode 100644 index 00000000000..caf25135a46 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Criterion.java @@ -0,0 +1,33 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface Criterion extends CmmnElement { + + String getName(); + + void setName(String name); + + Sentry getSentry(); + + void setSentry(Sentry sentry); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Decision.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Decision.java new file mode 100644 index 00000000000..1b3ea533181 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Decision.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public interface Decision extends CmmnElement { + + String getName(); + + void setName(String name); + + String getImplementationType(); + + void setImplementationType(String implementationType); + + Collection getInputs(); + + Collection getOutputs(); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/DecisionParameter.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/DecisionParameter.java new file mode 100644 index 00000000000..f82c501568d --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/DecisionParameter.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface DecisionParameter extends Parameter { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/DecisionRefExpression.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/DecisionRefExpression.java new file mode 100644 index 00000000000..8edc5b2dba2 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/DecisionRefExpression.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface DecisionRefExpression extends Expression { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/DecisionTask.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/DecisionTask.java new file mode 100644 index 00000000000..c1e0cfd482f --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/DecisionTask.java @@ -0,0 +1,59 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public interface DecisionTask extends Task { + + String getDecision(); + + void setDecision(String decision); + + DecisionRefExpression getDecisionExpression(); + + void setDecisionExpression(DecisionRefExpression decisionExpression); + + Collection getParameterMappings(); + + /** Camunda extensions */ + + String getCamundaResultVariable(); + + void setCamundaResultVariable(String camundaResultVariable); + + String getCamundaDecisionBinding(); + + void setCamundaDecisionBinding(String camundaDecisionBinding); + + String getCamundaDecisionVersion(); + + void setCamundaDecisionVersion(String camundaDecisionVersion); + + String getCamundaDecisionTenantId(); + + void setCamundaDecisionTenantId(String camundaDecisionTenantId); + + String getCamundaMapDecisionResult(); + + void setCamundaMapDecisionResult(String camundaMapDecisionResult); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/DefaultControl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/DefaultControl.java new file mode 100644 index 00000000000..c774db4b752 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/DefaultControl.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface DefaultControl extends PlanItemControl { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Definitions.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Definitions.java new file mode 100644 index 00000000000..81b2ff7426c --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Definitions.java @@ -0,0 +1,73 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public interface Definitions extends CmmnModelElementInstance { + + String getId(); + + void setId(String id); + + String getName(); + + void setName(String name); + + String getTargetNamespace(); + + void setTargetNamespace(String namespace); + + String getExpressionLanguage(); + + void setExpressionLanguage(String expressionLanguage); + + String getExporter(); + + void setExporter(String exporter); + + String getExporterVersion(); + + void setExporterVersion(String exporterVersion); + + String getAuthor(); + + void setAuthor(String author); + + Collection getImports(); + + Collection getCaseFileItemDefinitions(); + + Collection getCases(); + + Collection getProcesses(); + + Collection getDecisions(); + + ExtensionElements getExtensionElements(); + + void setExtensionElements(ExtensionElements extensionElements); + + Collection getRelationships(); + + Collection getArtifacts(); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/DiscretionaryItem.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/DiscretionaryItem.java new file mode 100644 index 00000000000..3592a037223 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/DiscretionaryItem.java @@ -0,0 +1,44 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + + +/** + * @author Roman Smirnov + * + */ +public interface DiscretionaryItem extends TableItem { + + String getName(); + + void setName(String name); + + PlanItemDefinition getDefinition(); + + void setDefinition(PlanItemDefinition definition); + + ItemControl getItemControl(); + + void setItemControl(ItemControl itemControl); + + Collection getEntryCriterions(); + + Collection getExitCriterions(); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Documentation.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Documentation.java new file mode 100644 index 00000000000..f8b31f5a5c5 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Documentation.java @@ -0,0 +1,33 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface Documentation extends CmmnModelElementInstance { + + String getId(); + + void setId(String id); + + String getTextFormat(); + + void setTextFormat(String textFormat); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/EntryCriterion.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/EntryCriterion.java new file mode 100644 index 00000000000..8d02fdb7319 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/EntryCriterion.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface EntryCriterion extends Criterion { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Event.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Event.java new file mode 100644 index 00000000000..32546079af6 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Event.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface Event extends PlanItemDefinition, EventListener { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/EventListener.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/EventListener.java new file mode 100644 index 00000000000..7ff56853170 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/EventListener.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface EventListener extends PlanItemDefinition { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ExitCriterion.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ExitCriterion.java new file mode 100644 index 00000000000..99b3e18fa20 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ExitCriterion.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface ExitCriterion extends Criterion { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Expression.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Expression.java new file mode 100644 index 00000000000..d0085717cc8 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Expression.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface Expression extends CmmnElement { + + String getText(); + + void setText(String text); + + @Deprecated + String getBody(); + + @Deprecated + void setBody(String body); + + String getLanguage(); + + void setLanguage(String language); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ExtensionElements.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ExtensionElements.java new file mode 100644 index 00000000000..5424f046047 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ExtensionElements.java @@ -0,0 +1,38 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.Query; +import org.camunda.bpm.model.xml.instance.ModelElementInstance; + +/** + * @author Roman Smirnov + * + */ +public interface ExtensionElements extends CmmnModelElementInstance { + + Collection getElements(); + + Query getElementsQuery(); + + ModelElementInstance addExtensionElement(String namespaceUri, String localName); + + T addExtensionElement(Class extensionElementClass); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/HumanTask.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/HumanTask.java new file mode 100644 index 00000000000..01c253af821 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/HumanTask.java @@ -0,0 +1,77 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; +import java.util.List; + +/** + * @author Roman Smirnov + * + */ +public interface HumanTask extends Task { + + Role getPerformer(); + + void setPerformer(Role performerRef); + + @Deprecated + Collection getPlanningTables(); + + PlanningTable getPlanningTable(); + + void setPlanningTable(PlanningTable planningTable); + + /** camunda extensions */ + + String getCamundaAssignee(); + + void setCamundaAssignee(String camundaAssignee); + + String getCamundaCandidateGroups(); + + void setCamundaCandidateGroups(String camundaCandidateGroups); + + List getCamundaCandidateGroupsList(); + + void setCamundaCandidateGroupsList(List camundaCandidateGroupsList); + + String getCamundaCandidateUsers(); + + void setCamundaCandidateUsers(String camundaCandidateUsers); + + List getCamundaCandidateUsersList(); + + void setCamundaCandidateUsersList(List camundaCandidateUsersList); + + String getCamundaDueDate(); + + void setCamundaDueDate(String camundaDueDate); + + String getCamundaFollowUpDate(); + + void setCamundaFollowUpDate(String camundaFollowUpDate); + + String getCamundaFormKey(); + + void setCamundaFormKey(String camundaFormKey); + + String getCamundaPriority(); + + void setCamundaPriority(String camundaPriority); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/IfPart.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/IfPart.java new file mode 100644 index 00000000000..9478357bbc8 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/IfPart.java @@ -0,0 +1,38 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public interface IfPart extends CmmnElement { + + CaseFileItem getContext(); + + void setContext(CaseFileItem caseFileItem); + + @Deprecated + public Collection getConditions(); + + ConditionExpression getCondition(); + + void setCondition(ConditionExpression condition); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Import.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Import.java new file mode 100644 index 00000000000..b8565ef9279 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Import.java @@ -0,0 +1,38 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface Import extends CmmnModelElementInstance { + + String getNamespace(); + + void setNamespace(String namespace); + + String getLocation(); + + void setLocation(String location); + + String getImportType(); + + void setImportType(String importType); + + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/InputCaseParameter.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/InputCaseParameter.java new file mode 100644 index 00000000000..a7d6004f58c --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/InputCaseParameter.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface InputCaseParameter extends CaseParameter { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/InputDecisionParameter.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/InputDecisionParameter.java new file mode 100644 index 00000000000..1452b0b8296 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/InputDecisionParameter.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface InputDecisionParameter extends DecisionParameter { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/InputProcessParameter.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/InputProcessParameter.java new file mode 100644 index 00000000000..e97f971256c --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/InputProcessParameter.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface InputProcessParameter extends ProcessParameter { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/InputsCaseParameter.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/InputsCaseParameter.java new file mode 100644 index 00000000000..3904cd6fa34 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/InputsCaseParameter.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface InputsCaseParameter extends CaseParameter { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ItemControl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ItemControl.java new file mode 100644 index 00000000000..3ea7efc76a4 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ItemControl.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface ItemControl extends PlanItemControl { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ManualActivationRule.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ManualActivationRule.java new file mode 100644 index 00000000000..70476a58e6d --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ManualActivationRule.java @@ -0,0 +1,38 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + + +/** + * @author Roman Smirnov + * + */ +public interface ManualActivationRule extends CmmnElement { + + String getName(); + + void setName(String name); + + CaseFileItem getContext(); + + void setContext(CaseFileItem caseFileItem); + + ConditionExpression getCondition(); + + void setCondition(ConditionExpression condition); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Milestone.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Milestone.java new file mode 100644 index 00000000000..6b9cab7abb9 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Milestone.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface Milestone extends PlanItemDefinition { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/OnPart.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/OnPart.java new file mode 100644 index 00000000000..462b98b4445 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/OnPart.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface OnPart extends CmmnElement { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/OutputCaseParameter.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/OutputCaseParameter.java new file mode 100644 index 00000000000..a575f0599f4 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/OutputCaseParameter.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface OutputCaseParameter extends CaseParameter { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/OutputDecisionParameter.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/OutputDecisionParameter.java new file mode 100644 index 00000000000..2c5b73d2fc5 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/OutputDecisionParameter.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface OutputDecisionParameter extends DecisionParameter { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/OutputProcessParameter.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/OutputProcessParameter.java new file mode 100644 index 00000000000..85af8c0f8df --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/OutputProcessParameter.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface OutputProcessParameter extends ProcessParameter { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/OutputsCaseParameter.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/OutputsCaseParameter.java new file mode 100644 index 00000000000..a7dff589b41 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/OutputsCaseParameter.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface OutputsCaseParameter extends CaseParameter { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Parameter.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Parameter.java new file mode 100644 index 00000000000..9f23c7860ed --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Parameter.java @@ -0,0 +1,29 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface Parameter extends CmmnElement { + + String getName(); + + void setName(String name); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ParameterMapping.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ParameterMapping.java new file mode 100644 index 00000000000..6b49bb5fb76 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ParameterMapping.java @@ -0,0 +1,37 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface ParameterMapping extends CmmnElement { + + Parameter getSource(); + + void setSource(Parameter parameter); + + Parameter getTarget(); + + void setTarget(Parameter parameter); + + TransformationExpression getTransformation(); + + void setTransformation(TransformationExpression transformationExpression); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/PlanFragment.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/PlanFragment.java new file mode 100644 index 00000000000..15ee88f27ee --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/PlanFragment.java @@ -0,0 +1,31 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public interface PlanFragment extends PlanItemDefinition { + + Collection getPlanItems(); + + Collection getSentrys(); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/PlanItem.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/PlanItem.java new file mode 100644 index 00000000000..c334e4ca543 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/PlanItem.java @@ -0,0 +1,60 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public interface PlanItem extends CmmnElement { + + String getName(); + + void setName(String name); + + PlanItemDefinition getDefinition(); + + void setDefinition(PlanItemDefinition definition); + + @Deprecated + Collection getEntryCriterias(); + + @Deprecated + Collection getExitCriterias(); + + /** + * @return an immutable collection + */ + Collection getEntryCriteria(); + + /** + * @return an immutable collection + */ + Collection getExitCriteria(); + + Collection getEntryCriterions(); + + Collection getExitCriterions(); + + ItemControl getItemControl(); + + void setItemControl(ItemControl itemControl); + + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/PlanItemControl.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/PlanItemControl.java new file mode 100644 index 00000000000..ce2483a3c0f --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/PlanItemControl.java @@ -0,0 +1,37 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface PlanItemControl extends CmmnElement { + + RepetitionRule getRepetitionRule(); + + void setRepetitionRule(RepetitionRule repetitionRule); + + RequiredRule getRequiredRule(); + + void setRequiredRule(RequiredRule requiredRule); + + ManualActivationRule getManualActivationRule(); + + void setManualActivationRule(ManualActivationRule manualActivationRule); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/PlanItemDefinition.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/PlanItemDefinition.java new file mode 100644 index 00000000000..34239fda6e6 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/PlanItemDefinition.java @@ -0,0 +1,33 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface PlanItemDefinition extends CmmnElement { + + String getName(); + + void setName(String name); + + DefaultControl getDefaultControl(); + + void setDefaultControl(DefaultControl defaultControl); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/PlanItemOnPart.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/PlanItemOnPart.java new file mode 100644 index 00000000000..efb4dce6a87 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/PlanItemOnPart.java @@ -0,0 +1,45 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import org.camunda.bpm.model.cmmn.PlanItemTransition; + +/** + * @author Roman Smirnov + * + */ +public interface PlanItemOnPart extends OnPart { + + @Deprecated + Sentry getSentry(); + + @Deprecated + void setSentry(Sentry sentry); + + ExitCriterion getExitCriterion(); + + void setExitCriterion(ExitCriterion exitCriterion); + + PlanItem getSource(); + + void setSource(PlanItem source); + + PlanItemTransition getStandardEvent(); + + void setStandardEvent(PlanItemTransition standardEvent); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/PlanItemStartTrigger.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/PlanItemStartTrigger.java new file mode 100644 index 00000000000..b3003a6c00b --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/PlanItemStartTrigger.java @@ -0,0 +1,35 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import org.camunda.bpm.model.cmmn.PlanItemTransition; + +/** + * @author Roman Smirnov + * + */ +public interface PlanItemStartTrigger extends StartTrigger { + + PlanItem getSource(); + + void setSource(PlanItem source); + + PlanItemTransition getStandardEvent(); + + void setStandardEvent(PlanItemTransition standardEvent); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/PlanItemTransitionStandardEvent.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/PlanItemTransitionStandardEvent.java new file mode 100644 index 00000000000..8bbb57d87e3 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/PlanItemTransitionStandardEvent.java @@ -0,0 +1,27 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import org.camunda.bpm.model.cmmn.PlanItemTransition; + +public interface PlanItemTransitionStandardEvent extends CmmnModelElementInstance { + + PlanItemTransition getValue(); + + void setValue(PlanItemTransition value); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/PlanningTable.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/PlanningTable.java new file mode 100644 index 00000000000..537ebebfb53 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/PlanningTable.java @@ -0,0 +1,31 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public interface PlanningTable extends TableItem { + + Collection getTableItems(); + + Collection getApplicabilityRules(); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Process.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Process.java new file mode 100644 index 00000000000..443da942155 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Process.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public interface Process extends CmmnElement { + + String getName(); + + void setName(String name); + + String getImplementationType(); + + void setImplementationType(String implementationType); + + Collection getInputs(); + + Collection getOutputs(); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ProcessParameter.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ProcessParameter.java new file mode 100644 index 00000000000..cf3c5aac63d --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ProcessParameter.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface ProcessParameter extends Parameter { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ProcessRefExpression.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ProcessRefExpression.java new file mode 100644 index 00000000000..454d8e2d432 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ProcessRefExpression.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface ProcessRefExpression extends Expression { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ProcessTask.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ProcessTask.java new file mode 100644 index 00000000000..71f56e6e292 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/ProcessTask.java @@ -0,0 +1,51 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public interface ProcessTask extends Task { + + String getProcess(); + + void setProcess(String process); + + ProcessRefExpression getProcessExpression(); + + void setProcessExpression(ProcessRefExpression processExpression); + + Collection getParameterMappings(); + + /** camunda extensions */ + + String getCamundaProcessBinding(); + + void setCamundaProcessBinding(String camundaProcessBinding); + + String getCamundaProcessVersion(); + + void setCamundaProcessVersion(String camundaProcessVersion); + + String getCamundaProcessTenantId(); + + void setCamundaProcessTenantId(String camundaProcessTenantId); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Property.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Property.java new file mode 100644 index 00000000000..4ab92919dde --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Property.java @@ -0,0 +1,33 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface Property extends CmmnElement { + + String getName(); + + void setName(String name); + + String getType(); + + void setType(String type); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Relationship.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Relationship.java new file mode 100644 index 00000000000..35d655da208 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Relationship.java @@ -0,0 +1,41 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.RelationshipDirection; + +/** + * @author Roman Smirnov + * + */ +public interface Relationship extends CmmnElement { + + String getType(); + + void setType(String type); + + RelationshipDirection getDirection(); + + void setDirection(RelationshipDirection direction); + + Collection getSources(); + + Collection getTargets(); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/RepetitionRule.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/RepetitionRule.java new file mode 100644 index 00000000000..481ff9dd035 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/RepetitionRule.java @@ -0,0 +1,43 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface RepetitionRule extends CmmnElement { + + String getName(); + + void setName(String name); + + CaseFileItem getContext(); + + void setContext(CaseFileItem caseFileItem); + + ConditionExpression getCondition(); + + void setCondition(ConditionExpression condition); + + /** Camunda extensions */ + + String getCamundaRepeatOnStandardEvent(); + + void setCamundaRepeatOnStandardEvent(String standardEvent); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/RequiredRule.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/RequiredRule.java new file mode 100644 index 00000000000..b98c624f520 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/RequiredRule.java @@ -0,0 +1,37 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface RequiredRule extends CmmnElement { + + String getName(); + + void setName(String name); + + CaseFileItem getContext(); + + void setContext(CaseFileItem caseFileItem); + + ConditionExpression getCondition(); + + void setCondition(ConditionExpression condition); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Role.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Role.java new file mode 100644 index 00000000000..d6fffa7d1da --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Role.java @@ -0,0 +1,29 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface Role extends CmmnElement { + + String getName(); + + void setName(String name); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Sentry.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Sentry.java new file mode 100644 index 00000000000..7c0b7bedb32 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Sentry.java @@ -0,0 +1,37 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public interface Sentry extends CmmnElement { + + String getName(); + + void setName(String name); + + Collection getOnParts(); + + IfPart getIfPart(); + + void setIfPart(IfPart ifPart); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Source.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Source.java new file mode 100644 index 00000000000..4c70a85d5d9 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Source.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface Source extends CmmnModelElementInstance { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Stage.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Stage.java new file mode 100644 index 00000000000..c6925dc83c7 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Stage.java @@ -0,0 +1,44 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public interface Stage extends PlanFragment { + + boolean isAutoComplete(); + + void setAutoComplete(boolean autoComplete); + + @Deprecated + Collection getExitCriterias(); + + Collection getExitCriteria(); + + Collection getExitCriterions(); + + PlanningTable getPlanningTable(); + + void setPlanningTable(PlanningTable planningTable); + + Collection getPlanItemDefinitions(); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/StartTrigger.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/StartTrigger.java new file mode 100644 index 00000000000..9fe435c0445 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/StartTrigger.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface StartTrigger extends CmmnElement { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/TableItem.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/TableItem.java new file mode 100644 index 00000000000..46d15a729e4 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/TableItem.java @@ -0,0 +1,33 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public interface TableItem extends CmmnElement { + + Collection getApplicabilityRule(); + + Collection getAuthorizedRoles(); + + + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Target.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Target.java new file mode 100644 index 00000000000..4206e1276b9 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Target.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface Target extends CmmnModelElementInstance { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Task.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Task.java new file mode 100644 index 00000000000..b751c12e542 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Task.java @@ -0,0 +1,41 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public interface Task extends PlanItemDefinition { + + boolean isBlocking(); + + void setIsBlocking(boolean isBlocking); + + @Deprecated + Collection getInputs(); + + @Deprecated + Collection getOutputs(); + + Collection getInputParameters(); + + Collection getOutputParameters(); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Text.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Text.java new file mode 100644 index 00000000000..760b09e0316 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/Text.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface Text extends CmmnModelElementInstance { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/TextAnnotation.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/TextAnnotation.java new file mode 100644 index 00000000000..3d828922ca0 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/TextAnnotation.java @@ -0,0 +1,33 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface TextAnnotation extends Artifact { + + String getTextFormat(); + + void setTextFormat(String textFormat); + + Text getText(); + + void setText(Text text); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/TimerEvent.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/TimerEvent.java new file mode 100644 index 00000000000..81f057156dd --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/TimerEvent.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface TimerEvent extends Event { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/TimerEventListener.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/TimerEventListener.java new file mode 100644 index 00000000000..fea2560e2c7 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/TimerEventListener.java @@ -0,0 +1,33 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface TimerEventListener extends EventListener { + + TimerExpression getTimerExpression(); + + void setTimerExpression(TimerExpression timerExpression); + + StartTrigger getTimerStart(); + + void setTimerStart(StartTrigger timerStart); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/TimerExpression.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/TimerExpression.java new file mode 100644 index 00000000000..6be90ad95fd --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/TimerExpression.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface TimerExpression extends Expression { + +} \ No newline at end of file diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/TransformationExpression.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/TransformationExpression.java new file mode 100644 index 00000000000..a440b38424f --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/TransformationExpression.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface TransformationExpression extends Expression { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/UserEvent.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/UserEvent.java new file mode 100644 index 00000000000..41244fbc616 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/UserEvent.java @@ -0,0 +1,25 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +/** + * @author Roman Smirnov + * + */ +public interface UserEvent extends Event { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/UserEventListener.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/UserEventListener.java new file mode 100644 index 00000000000..5a5fcc90458 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/UserEventListener.java @@ -0,0 +1,29 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public interface UserEventListener extends EventListener { + + Collection getAuthorizedRoles(); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaCaseExecutionListener.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaCaseExecutionListener.java new file mode 100644 index 00000000000..e770d7dc3d4 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaCaseExecutionListener.java @@ -0,0 +1,51 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance.camunda; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstance; + +/** + * @author Roman Smirnov + * + */ +public interface CamundaCaseExecutionListener extends CmmnModelElementInstance { + + String getCamundaEvent(); + + void setCamundaEvent(String camundaEvent); + + String getCamundaClass(); + + void setCamundaClass(String camundaClass); + + String getCamundaExpression(); + + void setCamundaExpression(String camundaExpression); + + String getCamundaDelegateExpression(); + + void setCamundaDelegateExpression(String camundaDelegateExpression); + + CamundaScript getCamundaScript(); + + void setCamundaScript(CamundaScript camundaScript); + + Collection getCamundaFields(); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaExpression.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaExpression.java new file mode 100644 index 00000000000..b370efafee0 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaExpression.java @@ -0,0 +1,27 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance.camunda; + +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstance; + +/** + * @author Roman Smirnov + * + */ +public interface CamundaExpression extends CmmnModelElementInstance { + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaField.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaField.java new file mode 100644 index 00000000000..57c60f72dcf --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaField.java @@ -0,0 +1,47 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance.camunda; + +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstance; + +/** + * @author Roman Smirnov + * + */ +public interface CamundaField extends CmmnModelElementInstance { + + String getCamundaName(); + + void setCamundaName(String camundaName); + + String getCamundaExpression(); + + void setCamundaExpression(String camundaExpression); + + String getCamundaStringValue(); + + void setCamundaStringValue(String camundaStringValue); + + CamundaString getCamundaString(); + + void setCamundaString(CamundaString camundaString); + + CamundaExpression getCamundaExpressionChild(); + + void setCamundaExpressionChild(CamundaExpression camundaExpression); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaIn.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaIn.java new file mode 100644 index 00000000000..430aa06d67e --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaIn.java @@ -0,0 +1,55 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance.camunda; + +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstance; + + +/** + * The CMMN in camunda extension element + * + * @author Sebastian Menski + * @author Roman Smirnov + * + */ +public interface CamundaIn extends CmmnModelElementInstance { + + String getCamundaSource(); + + void setCamundaSource(String camundaSource); + + String getCamundaSourceExpression(); + + void setCamundaSourceExpression(String camundaSourceExpression); + + String getCamundaVariables(); + + void setCamundaVariables(String camundaVariables); + + String getCamundaTarget(); + + void setCamundaTarget(String camundaTarget); + + String getCamundaBusinessKey(); + + void setCamundaBusinessKey(String camundaBusinessKey); + + boolean getCamundaLocal(); + + void setCamundaLocal(boolean local); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaOut.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaOut.java new file mode 100644 index 00000000000..4b239278a50 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaOut.java @@ -0,0 +1,46 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance.camunda; + +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstance; + +/** + * The CMMN out camunda extension element + * + * @author Sebastian Menski + * @author Roman Smirnov + * + */ +public interface CamundaOut extends CmmnModelElementInstance { + + String getCamundaSource(); + + void setCamundaSource(String camundaSource); + + String getCamundaSourceExpression(); + + void setCamundaSourceExpression(String camundaSourceExpression); + + String getCamundaVariables(); + + void setCamundaVariables(String camundaVariables); + + String getCamundaTarget(); + + void setCamundaTarget(String camundaTarget); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaScript.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaScript.java new file mode 100644 index 00000000000..8987c21d6e0 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaScript.java @@ -0,0 +1,35 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance.camunda; + +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstance; + +/** + * @author Roman Smirnov + * + */ +public interface CamundaScript extends CmmnModelElementInstance { + + String getCamundaScriptFormat(); + + void setCamundaScriptFormat(String scriptFormat); + + String getCamundaResource(); + + void setCamundaResoure(String resource); + +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaString.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaString.java new file mode 100644 index 00000000000..edc19ad4d67 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaString.java @@ -0,0 +1,26 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance.camunda; + +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstance; + +/** + * @author Roman Smirnov + * + */ +public interface CamundaString extends CmmnModelElementInstance { +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaTaskListener.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaTaskListener.java new file mode 100644 index 00000000000..4f83a953e3b --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaTaskListener.java @@ -0,0 +1,50 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance.camunda; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstance; + +/** + * @author Roman Smirnov + * + */ +public interface CamundaTaskListener extends CmmnModelElementInstance { + + String getCamundaEvent(); + + void setCamundaEvent(String camundaEvent); + + String getCamundaClass(); + + void setCamundaClass(String camundaClass); + + String getCamundaExpression(); + + void setCamundaExpression(String camundaExpression); + + String getCamundaDelegateExpression(); + + void setCamundaDelegateExpression(String camundaDelegateExpression); + + CamundaScript getCamundaScript(); + + void setCamundaScript(CamundaScript camundaScript); + + Collection getCamundaFields(); +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaVariableListener.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaVariableListener.java new file mode 100644 index 00000000000..4226a3bb31b --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaVariableListener.java @@ -0,0 +1,50 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance.camunda; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstance; + +/** + * @author Thorben Lindhauer + * + */ +public interface CamundaVariableListener extends CmmnModelElementInstance { + + String getCamundaEvent(); + + void setCamundaEvent(String camundaEvent); + + String getCamundaClass(); + + void setCamundaClass(String camundaClass); + + String getCamundaExpression(); + + void setCamundaExpression(String camundaExpression); + + String getCamundaDelegateExpression(); + + void setCamundaDelegateExpression(String camundaDelegateExpression); + + Collection getCamundaFields(); + + CamundaScript getCamundaScript(); + + void setCamundaScript(CamundaScript camundaScript); +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaVariableOnPart.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaVariableOnPart.java new file mode 100644 index 00000000000..6efb3e602e6 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaVariableOnPart.java @@ -0,0 +1,35 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance.camunda; + +import org.camunda.bpm.model.cmmn.VariableTransition; +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstance; +/** + * + * @author Deivarayan Azhagappan + * + */ +public interface CamundaVariableOnPart extends CmmnModelElementInstance { + + String getVariableName(); + + void setVariableName(String variableName); + + VariableTransition getVariableEvent(); + + void setVariableEvent(VariableTransition standardEvent); +} diff --git a/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaVariableTransitionEvent.java b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaVariableTransitionEvent.java new file mode 100644 index 00000000000..4ee7d643549 --- /dev/null +++ b/model-api/cmmn-model/src/main/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaVariableTransitionEvent.java @@ -0,0 +1,32 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance.camunda; + +import org.camunda.bpm.model.cmmn.VariableTransition; +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstance; +/** + * + * @author Deivarayan Azhagappan + * + */ +public interface CamundaVariableTransitionEvent extends CmmnModelElementInstance { + + VariableTransition getValue(); + + void setValue(VariableTransition value); + +} diff --git a/model-api/cmmn-model/src/main/resources/cmmn10/CMMN10.xsd b/model-api/cmmn-model/src/main/resources/cmmn10/CMMN10.xsd new file mode 100644 index 00000000000..bf9fdb18a8b --- /dev/null +++ b/model-api/cmmn-model/src/main/resources/cmmn10/CMMN10.xsd @@ -0,0 +1,64 @@ + + + + + + + Include the CMMN 1.0 Case Model XML-Schema in the same namespace. + + + + + + + + + definitions is the root element of ALL CMMN elements. It is used as a container + for CMMN elements that might be re-used. + + + + + + + + tDefinitions defines the type of element "definitions". + + + + + + + + + + + + + + + + + + + + + + + + import is the root element for all imports in CMMN definitions. + + + + + + + + diff --git a/model-api/cmmn-model/src/main/resources/cmmn10/CMMN10CaseModel.xsd b/model-api/cmmn-model/src/main/resources/cmmn10/CMMN10CaseModel.xsd new file mode 100644 index 00000000000..1e9a7bfe55d --- /dev/null +++ b/model-api/cmmn-model/src/main/resources/cmmn10/CMMN10CaseModel.xsd @@ -0,0 +1,1090 @@ + + + + + + + + tCmmnElement is the base type for ALL CMMN complex types except tExpression. + + + + + + + + + + + + + + + tCmmnElementWithMixedContent is the base type for complex type tExpression. It is + identical to tCmmnElement except that it allows for mixed content. + + + + + + + + + + + + + + + + tExtensionElements allows to extend the specified meta model in a way that it is + still CMMN-compliant. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + case is the root element for all CMMN case models. It is the container + for the Case File and Plan Model. + + + + + + + tCase defines the type of element "case". + + + + + + + + + + + + + + + + + + + + role is the root element for Case Roles. + + + + + + + tRole defines the type of element "role". + + + + + + + + + + + + + + planItemControl is the root element for Case Plan Control elements + including the RepetitionRule, RequiredRule and ManualActivationRule. + + + + + + + tPlanItemcontrol defines the type of element "planItemControl". + + + + + + + + + + + + + + + + + repetitionRule is the root element for specifying a + repetition rule for a PlanItemDefinition element. + + + + + + + tRepetitionRule defines the type of element "repetitionRule". + + + + + + + + + + + + contextRef MUST refer a CaseFileItem if specified. + + + + + + + + + + + requiredRule is the root element for specifying a + required rule for a PlanItemDefinition element. + + + + + + + tRequiredRule defines the type of element "requiredRule". + + + + + + + + + + + + contextRef MUST refer a CaseFileItem if specified. + + + + + + + + + + + manualActivationRule is the root element for specifying an + manual activation rule for a PlanItemDefinition element. + + + + + + + tManualActivationRule defines the type of element "manualActivationRule". + + + + + + + + + + + + contextRef MUST refer a CaseFileItem if specified. + + + + + + + + + + + + caseFile is the root element for the CMMN Case File Model + and is a container for CaseFileItems. + + + + + + + tCaseFile defines the type of element "caseFile". + + + + + + + + + + + + + + + caseFileItem is the root element for CMMN data. + + + + + + + tCaseFileItem defines the type of element "caseFileItem". + + + + + + + + + + + + + definitinRef MUST refer to a "caseFileItemDefinition" element. Since + CaseFileItemDefinition is re-usable, QName is used for reference. + + + + + + + sourceRef MUST refer to a "caseFileItem" element in the case where this + "caseFileItem" has a parent. + + + + + + + If this "caseFileItem" maintains references to "caseFileItem" childs, then + targetRefs MUST refer to "caseFileItem" elements; the targets of this caseFileItem. + + + + + + + + + + + tChildren defines a container for zero or more "caseFileItem" elements. + + + + + + + + + + + + + + + caseFileItemDefinition defines the type of a "caseFileItem". + + + + + + + tCaseFileItemDefinition defines the type of element "caseFileItemDefinition" + + + + + + + + + + + + + structureRef refers a structure, for example an XML-Schema element + in a XSD referred by importRef + + + + + + + importRef refers an "import" element under "definitions" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + task represents an (abstract) Task in the Case Model and comprises + of inputs, outputs and a flag if the task is blocking or not. + + + + + + + + + + + + + + + + + + + event represents an (abstract) Event in the Case Model. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bindingRef refers a "caseFileItem" element + + + + + + + + + + + + + + + + + + + humanTask represents a HumanTask in the Case Model and comprises of + zero or one PlanningTable and a reference to a Role (the performer of + the human task). + + + + + + + tHumanTask defines the type of element "humanTask" + + + + + + + + + + + performerRef refers a "role" element + + + + + + + + + + + processTask represents a ProcessTask in the Case Model and comprises of + ParameterMappings and a reference to an (abstract) Process. + + + + + + + tProcessTask defines the type of element "process" + + + + + + + + + + + processRef refers a "process" element which is re-usable and can + be imported via some other file. + + + + + + + + + + + process represents an (abstract) Business Process in CMMN. It has + a implementationType, inputs and outputs and can be referred from + a ProcessTask. + + + + + + + tProcess defines the type of element "process" + + + + + + + + + + + + + + + + + + Enumeration of Business Process standards known to CMMN 1.0 + + + + + + + + + + + + + + + + + + + + caseTask is the root element for CaseTask in the Case Model and + comprises of ParameterMappings and a reference to a Case + + + + + + + tCaseTask defines the type of element "caseTask" + + + + + + + + + + + caseRef refers a "case" element which is re-usable and can + be imported via some other file. + + + + + + + + + + + + + + + + + + sourceRef refers a "parameter" element + + + + + + + targetRef refers a "parameter" element + + + + + + + + + + + + + + + + + + + + + + + + + timerExpression is supposed to be an ISO-8601 conformant expression + + + + + + + timerStart can be used to trigger the timer after a PlanItem or CaseFileItem + lifecycle state transition has occurred. + + + + + + + + + + + + + + + + + + + + + + + + + + + sourceRef refers a "caseFileItem" element + + + + + + + + + + + + + + + + + + sourceRef refers a "planItem" element + + + + + + + + + + + + sentry is the root element of "Sentry" in the Case Model and + comprises of zero or more OnParts and zero or one IfPart. + + + + + + + tSentry defines the type of element "sentry" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + sourceRef refers a "caseFileItem" element + + + + + + + + + + + + + + + + + + sourceRef refers a "planItem" element + + + + + + + sentryRef refers a "Sentry" element + + + + + + + + + + + + + + + + + + contextRef refers a "caseFileItem" element + + + + + + + + + + + Enumeration of CaseFileItem transitions. + + + + + + + + + + + + + + + + + + Enumeration of PlanItem transitions. + + + + + + + + + + + + + + + + + + + + + + + + + + + + planFragment is the root element for PlanItems that should go into + the plan as a unit. + + + + + + + tPlanFragment defines the type for element "planFragment" + + + + + + + + + + + + + + + + stage represents a Stage in the Case Model and comprises of + zero or one PlanningTable, zero or more PlanItemDefinition elements + and if the Stage is the outermost Stage, zero or more references to + exit criteria Sentries. + + + + + + + tStage defines the type for element "stage" + + + + + + + + + + + + + exitCriteriaRefs refers zero or more "sentry" elements. + + + + + + + + + + + + + + + + + + + definitionRef refers a "planItemDefinition" element. + + + + + + + entryCriteriaRefs refers "sentry" elements. + + + + + + + exitCriteriaRefs refers "sentry" elements. + + + + + + + + + + + + + + + + applicabilityRuleRefs refers one or more "applicabilityRule" elements. + + + + + + + authorizedRoleRefs refers zero or more "role" elements. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + definitionRef refers a "planItemDefinition" element + + + + + + + + + + + + + + + + + + contexRef refers a "caseFileItem" element + + + + + + + diff --git a/model-api/cmmn-model/src/main/resources/cmmn11/CMMN11.xsd b/model-api/cmmn-model/src/main/resources/cmmn11/CMMN11.xsd new file mode 100644 index 00000000000..8ca379b96ca --- /dev/null +++ b/model-api/cmmn-model/src/main/resources/cmmn11/CMMN11.xsd @@ -0,0 +1,78 @@ + + + + + + + Include the CMMN 1.1 Case Model XML-Schema in the same namespace. + + + + + + + + Include the CMMN 1.1 Diagram Interchange (DI) schema + + + + + + + + + definitions is the root element of ALL CMMN elements. It is used as a container + for CMMN elements that might be re-used. + + + + + + + + tDefinitions defines the type of element "definitions". + + + + + + + + + + + + + + + + + + + + + + + + + + + + import is the root element for all imports in CMMN definitions. + + + + + + + + diff --git a/model-api/cmmn-model/src/main/resources/cmmn11/CMMN11CaseModel.xsd b/model-api/cmmn-model/src/main/resources/cmmn11/CMMN11CaseModel.xsd new file mode 100644 index 00000000000..20a8db0e223 --- /dev/null +++ b/model-api/cmmn-model/src/main/resources/cmmn11/CMMN11CaseModel.xsd @@ -0,0 +1,1337 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + tCmmnElement is the base type for ALL CMMN complex types except tExpression. + + + + + + + + + + + + + + + tCmmnElementWithMixedContent is the base type for complex type tExpression + and tDocumentation. It is identical to tCmmnElement except that it allows + for mixed content. + + + + + + + + + + + + + + + + + + + + + + + + case is the root element for all CMMN case models. It is the container + for the Case File and Plan Model. + + + + + + + tCase defines the type of element "case". + + + + + + + + + + + + + + + + + + + + tCaseRoles defines the type of element "caseRoles inside tCase". + + + + + + + + + + + + + + + role is the root element for Case Roles. + + + + + + + tRole defines the type of element "role". + + + + + + + + + + + + + + planItemControl is the root element for Case Plan Control elements + including the RepetitionRule, RequiredRule and ManualActivationRule. + + + + + + + tPlanItemcontrol defines the type of element "planItemControl". + + + + + + + + + + + + + + + + + repetitionRule is the root element for specifying a + repetition rule for a PlanItemDefinition element. + + + + + + + tRepetitionRule defines the type of element "repetitionRule". + + + + + + + + + + + + contextRef MUST refer a CaseFileItem if specified. + + + + + + + + + + + requiredRule is the root element for specifying a + required rule for a PlanItemDefinition element. + + + + + + + tRequiredRule defines the type of element "requiredRule". + + + + + + + + + + + + contextRef MUST refer a CaseFileItem if specified. + + + + + + + + + + + manualActivationRule is the root element for specifying an + manual activation rule for a PlanItemDefinition element. + + + + + + + tManualActivationRule defines the type of element "manualActivationRule". + + + + + + + + + + + + contextRef MUST refer a CaseFileItem if specified. + + + + + + + + + + + + caseFile is the root element for the CMMN Case File Model + and is a container for CaseFileItems. + + + + + + + tCaseFile defines the type of element "caseFile". + + + + + + + + + + + + + + + + caseFileItem is the root element for CMMN data. + + + + + + + tCaseFileItem defines the type of element "caseFileItem". + + + + + + + + + + + + + definitinRef MUST refer to a "caseFileItemDefinition" element. Since + CaseFileItemDefinition is re-usable, QName is used for reference. + + + + + + + sourceRef MUST refer to a "caseFileItem" element in the case where this + "caseFileItem" has a parent. + + + + + + + If this "caseFileItem" maintains references to "caseFileItem" childs, then + targetRefs MUST refer to "caseFileItem" elements; the targets of this caseFileItem. + + + + + + + + + + + tChildren defines a container for zero or more "caseFileItem" elements. + + + + + + + + + + + + + + + caseFileItemDefinition defines the type of a "caseFileItem". + + + + + + + tCaseFileItemDefinition defines the type of element "caseFileItemDefinition" + + + + + + + + + + + + + structureRef refers a structure, for example an XML-Schema element + in a XSD referred by importRef + + + + + + + importRef refers an "import" element under "definitions" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + task represents an (abstract) Task in the Case Model and comprises + of input, output and a flag if the task is blocking or not. + + + + + + + + + + + + + + + + + + + event represents an (abstract) Event in the Case Model. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bindingRef refers a "caseFileItem" element + + + + + + + + + + + + + + + + + + + + + + + + + + + humanTask represents a HumanTask in the Case Model and comprises of + zero or one PlanningTable and a reference to a Role (the performer of + the human task). + + + + + + + tHumanTask defines the type of element "humanTask" + + + + + + + + + + + performerRef refers a "role" element + + + + + + + + + + + processTask represents a ProcessTask in the Case Model and comprises of + ParameterMappings and a reference to an (abstract) Process. + + + + + + + tProcessTask defines the type of element "process" + + + + + + + + + + processRefExpression is mutually exclusive to processRef. It allows the selection of a + process at runtime via an expression rather then at design time with processRef. + + + + + + + + processRef refers a "process" element which is re-usable and can + be imported via some other file. processRef is mutually exclusive to processRefExpression + + + + + + + + + + + process represents an (abstract) Business Process in CMMN. It has + an implementationType, input and output and can be referred from + a ProcessTask. + + + + + + + tProcess defines the type of element "process" + + + + + + + + + + + + + + + + + + + Enumeration of Business Process standards known to CMMN 1.1 + + + + + + + + + + + + + + + + + + + + caseTask is the root element for CaseTask in the Case Model and + comprises of ParameterMappings and a reference to a Case + + + + + + + tCaseTask defines the type of element "caseTask" + + + + + + + + + + caseRefExpression is mutualy exclusive to caseRef and can be used to select a case + at runtime rather then specifying caseRef at design-time. + + + + + + + + caseRef refers a "case" element which is re-usable and can + be imported via some other file. caseRef is mutually exclusive to "caseRefExpression" + + + + + + + + + + + decisionTask represents a DecisionTask in the Case Model and comprises of + ParameterMappings and a reference to an (abstract) Decision. + + + + + + + tDecisionTask defines the type of element "decision" + + + + + + + + + + decisionRefExpression is mutually exclusive to decisionRef. It allows the selection of a + decision at runtime via an expression rather then at design time with decisionRef. + + + + + + + + decisionRef refers a "decision" element which is re-usable and can + be imported via some other file. decisionRef is mutually exclusive to decisionRefExpression + + + + + + + + + + + decision represents an (abstract) Decision in CMMN. It has + an implementationType, input and output and can be referred from + a DecisionTask. + + + + + + + tDecision defines the type of element "decision" + + + + + + + + + + + + + + + + + + + Enumeration of Decision standards known to CMMN 1.1 + + + + + + + + + + + + + + + + + + + + + + + + sourceRef refers a "parameter" element + + + + + + + targetRef refers a "parameter" element + + + + + + + + + + + + + + + + authorizedRoleRefs refers zero or more "role" elements. + + + + + + + + + + + + + + + + + timerExpression is supposed to be an ISO-8601 conformant expression + + + + + + + timerStart can be used to trigger the timer after a PlanItem or CaseFileItem + lifecycle state transition has occurred. + + + + + + + + + + + + + + + + + + + + + + + + + + + sourceRef refers a "caseFileItem" element + + + + + + + + + + + + + + + + + + sourceRef refers a "planItem" element + + + + + + + + + + + + sentry is the root element of "Sentry" in the Case Model and + comprises of zero or more OnParts and zero or one IfPart. + + + + + + + tSentry defines the type of element "sentry" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + sourceRef refers a "caseFileItem" element + + + + + + + + + + + + + + + + + + sourceRef refers a "planItem" element + + + + + + + exitCriterionRef refers a "ExitCriterion" element that is contained in the + "planItem" referred by sourceRef + + + + + + + + + + + + + + + + + + contextRef refers a "caseFileItem" element + + + + + + + + + + + Enumeration of CaseFileItem transitions. + + + + + + + + + + + + + + + + + + Enumeration of PlanItem transitions. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Criterion is the abstract base class for EntryCriterion and ExitCriterion. It is + primarily used for CMMN Diagram Interchange (CMMN DI). + + + + + + + sentryRef refers to an existing Sentry in this casePlanModel + + + + + + + + + + + + + + EntryCriterion is a place holder for Entry Criteria and is primarily used for + CMMN Diagram Interchange (CMMN DI) + + + + + + + + + + + + + ExitCriterion is a place holder for Exit Criteria and is primarily used for + CMMN Diagram Interchange (CMMN DI) + + + + + + + + + + + + planFragment is the root element for PlanItems that should go into + the plan as a unit. + + + + + + + tPlanFragment defines the type for element "planFragment" + + + + + + + + + + + + + + + + stage represents a Stage in the Case Model and comprises of + zero or one PlanningTable, zero or more PlanItemDefinition elements + and if the Stage is the outermost Stage, zero or more references to + exitCriterion. + + + + + + + + tStage defines the type for element "stage" + + + + + + + + + + + + + + + + + + + + + + + + + + + + definitionRef refers a "planItemDefinition" element. + + + + + + + + + + + + + + + + applicabilityRuleRefs refers one or more "applicabilityRule" elements. + + + + + + + authorizedRoleRefs refers zero or more "role" elements. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + definitionRef refers a "planItemDefinition" element + + + + + + + + + + + + + + + + + + + contexRef refers a "caseFileItem" element + + + + + + + diff --git a/model-api/cmmn-model/src/main/resources/cmmn11/CMMNDI11.xsd b/model-api/cmmn-model/src/main/resources/cmmn11/CMMNDI11.xsd new file mode 100755 index 00000000000..a7147afe22b --- /dev/null +++ b/model-api/cmmn-model/src/main/resources/cmmn11/CMMNDI11.xsd @@ -0,0 +1,89 @@ + + + + + + + + + This element should never be instantiated directly, but rather concrete implementation should. It is placed there only to be referred in the sequence + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/model-api/cmmn-model/src/main/resources/cmmn11/DC.xsd b/model-api/cmmn-model/src/main/resources/cmmn11/DC.xsd new file mode 100755 index 00000000000..2cea343fe97 --- /dev/null +++ b/model-api/cmmn-model/src/main/resources/cmmn11/DC.xsd @@ -0,0 +1,150 @@ + + + + + + + + + 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 + + + + + \ No newline at end of file diff --git a/model-api/cmmn-model/src/main/resources/cmmn11/DI.xsd b/model-api/cmmn-model/src/main/resources/cmmn11/DI.xsd new file mode 100755 index 00000000000..a5d769a1e78 --- /dev/null +++ b/model-api/cmmn-model/src/main/resources/cmmn11/DI.xsd @@ -0,0 +1,107 @@ + + + + + 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. + + + + + + + + + + + + an optional list of points relative to the origin of the nesting diagram that specifies the connected line segments of the edge + + + + + + + + + + + + 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. + + + + + + + + + Style contains formatting properties that affect the appearance or style of diagram elements, including diagram themselves. + + + + + + + + + + + + + + \ No newline at end of file diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/CmmnModelInstanceTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/CmmnModelInstanceTest.java new file mode 100644 index 00000000000..fc312180036 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/CmmnModelInstanceTest.java @@ -0,0 +1,47 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn; + +import org.camunda.bpm.model.cmmn.instance.Definitions; +import org.junit.Test; + +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; + +/** + * @author Filip Hrisafov + */ +public class CmmnModelInstanceTest { + + @Test + public void testClone() throws Exception { + + CmmnModelInstance modelInstance = Cmmn.createEmptyModel(); + + Definitions definitions = modelInstance.newInstance(Definitions.class); + definitions.setId("TestId"); + modelInstance.setDefinitions(definitions); + + CmmnModelInstance cloneInstance = modelInstance.clone(); + cloneInstance.getDefinitions().setId("TestId2"); + + assertThat(modelInstance.getDefinitions().getId(), is(equalTo("TestId"))); + assertThat(cloneInstance.getDefinitions().getId(), is(equalTo("TestId2"))); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/CmmnModelTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/CmmnModelTest.java new file mode 100644 index 00000000000..d80581d2fd1 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/CmmnModelTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn; + +import org.camunda.bpm.model.cmmn.util.ParseCmmnModelRule; +import org.junit.Before; +import org.junit.Rule; + +/** + * @author Roman Smirnov + * + */ +public abstract class CmmnModelTest { + + @Rule + public final ParseCmmnModelRule parseCmmnModelRule = new ParseCmmnModelRule(); + + protected CmmnModelInstance cmmnModelInstance; + + @Before + public void setup() { + cmmnModelInstance = parseCmmnModelRule.getCmmnModel(); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/CmmnTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/CmmnTest.java new file mode 100644 index 00000000000..c4b66bc3318 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/CmmnTest.java @@ -0,0 +1,34 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.junit.Test; + +/** + * @author Roman Smirnov + * + */ +public class CmmnTest { + + @Test + public void testCmmn() { + assertThat(Cmmn.INSTANCE).isNotNull(); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/CreateModelTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/CreateModelTest.java new file mode 100644 index 00000000000..c33ae9cf5ff --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/CreateModelTest.java @@ -0,0 +1,98 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn; + +import org.camunda.bpm.model.cmmn.instance.Case; +import org.camunda.bpm.model.cmmn.instance.CasePlanModel; +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstance; +import org.camunda.bpm.model.cmmn.instance.Definitions; +import org.camunda.bpm.model.cmmn.instance.HumanTask; +import org.camunda.bpm.model.cmmn.instance.PlanItem; +import org.camunda.bpm.model.cmmn.instance.Stage; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * @author Sebastian Menski + */ +public class CreateModelTest { + + public CmmnModelInstance modelInstance; + public Definitions definitions; + public Process process; + + @Before + public void createEmptyModel() { + modelInstance = Cmmn.createEmptyModel(); + definitions = modelInstance.newInstance(Definitions.class); + definitions.setTargetNamespace("http://camunda.org/examples"); + modelInstance.setDefinitions(definitions); + } + + protected T createElement(CmmnModelElementInstance parentElement, String id, Class elementClass) { + T element = modelInstance.newInstance(elementClass); + element.setAttributeValue("id", id, true); + parentElement.addChildElement(element); + return element; + } + + @Test + public void createCaseWithOneHumanTask() { + // create process + Case caseInstance = createElement(definitions, "case-with-one-human-task", Case.class); + + // create case plan model + CasePlanModel casePlanModel = createElement(caseInstance, "casePlanModel_1", CasePlanModel.class); + + // create elements + HumanTask humanTask = createElement(casePlanModel, "HumanTask_1", HumanTask.class); + + // create a plan item + PlanItem planItem = createElement(casePlanModel, "PlanItem_1", PlanItem.class); + + // set definition to human task + planItem.setDefinition(humanTask); + } + + @Test + public void createCaseWithOneStageAndNestedHumanTask() { + // create process + Case caseInstance = createElement(definitions, "case-with-one-human-task", Case.class); + + // create case plan model + CasePlanModel casePlanModel = createElement(caseInstance, "casePlanModel_1", CasePlanModel.class); + + // create a stage + Stage stage = createElement(casePlanModel, "Stage_1", Stage.class); + + // create elements + HumanTask humanTask = createElement(stage, "HumanTask_1", HumanTask.class); + + // create a plan item + PlanItem planItem = createElement(stage, "PlanItem_1", PlanItem.class); + + // set definition to human task + planItem.setDefinition(humanTask); + } + + @After + public void validateModel() { + Cmmn.validateModel(modelInstance); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/GenerateIdTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/GenerateIdTest.java new file mode 100644 index 00000000000..5bbad3b3366 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/GenerateIdTest.java @@ -0,0 +1,65 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.impl.instance.CaseFileItemTransitionStandardEventImpl; +import org.camunda.bpm.model.cmmn.instance.Case; +import org.camunda.bpm.model.cmmn.instance.CasePlanModel; +import org.camunda.bpm.model.cmmn.instance.DefaultControl; +import org.camunda.bpm.model.cmmn.instance.Definitions; +import org.camunda.bpm.model.cmmn.instance.HumanTask; +import org.junit.Test; + +public class GenerateIdTest { + + @Test + public void shouldNotGenerateIdsOnRead() { + CmmnModelInstance modelInstance = Cmmn.readModelFromStream(GenerateIdTest.class.getResourceAsStream("GenerateIdTest.cmmn")); + Definitions definitions = modelInstance.getDefinitions(); + assertThat(definitions.getId()).isNull(); + + Case caseElement = modelInstance.getModelElementsByType(Case.class).iterator().next(); + assertThat(caseElement.getId()).isNull(); + + CasePlanModel casePlanModel = modelInstance.getModelElementsByType(CasePlanModel.class).iterator().next(); + assertThat(casePlanModel.getId()).isNull(); + + HumanTask humanTask = modelInstance.getModelElementsByType(HumanTask.class).iterator().next(); + assertThat(humanTask.getId()).isNull(); + } + + @Test + public void shouldGenerateIdsOnCreate() { + CmmnModelInstance modelInstance = Cmmn.createEmptyModel(); + Definitions definitions = modelInstance.newInstance(Definitions.class); + assertThat(definitions.getId()).isNotNull(); + + Case caseElement = modelInstance.newInstance(Case.class); + assertThat(caseElement.getId()).isNotNull(); + + CasePlanModel casePlanModel = modelInstance.newInstance(CasePlanModel.class); + assertThat(casePlanModel.getId()).isNotNull(); + + HumanTask humanTask = modelInstance.newInstance(HumanTask.class); + assertThat(humanTask.getId()).isNotNull(); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/SimpleTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/SimpleTest.java new file mode 100644 index 00000000000..821cbe9c6d9 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/SimpleTest.java @@ -0,0 +1,74 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.Case; +import org.camunda.bpm.model.cmmn.instance.CasePlanModel; +import org.camunda.bpm.model.cmmn.instance.HumanTask; +import org.camunda.bpm.model.cmmn.instance.PlanItem; +import org.camunda.bpm.model.cmmn.instance.PlanItemDefinition; +import org.camunda.bpm.model.cmmn.util.CmmnModelResource; +import org.camunda.bpm.model.xml.instance.ModelElementInstance; +import org.junit.Test; + +/** + * @author Roman Smirnov + * + */ +public class SimpleTest extends CmmnModelTest { + + @Test + @CmmnModelResource + public void shouldGetElements() { + + ModelElementInstance modelElementById = cmmnModelInstance.getModelElementById("Case_1"); + assertThat(modelElementById).isNotNull(); + + Collection caseElements = cmmnModelInstance.getDefinitions().getCases(); + assertThat(caseElements).hasSize(1); + Case caseElement = caseElements.iterator().next(); + + assertThat(caseElement.getId()).isEqualTo("Case_1"); + assertThat(caseElement.getName()).isNull(); + + CasePlanModel casePlanModel = caseElement.getCasePlanModel(); + assertThat(casePlanModel).isNotNull(); + + assertThat(casePlanModel.getId()).isEqualTo("CasePlanModel_1"); + + Collection planItemDefinitions = casePlanModel.getPlanItemDefinitions(); + assertThat(planItemDefinitions).hasSize(1); + + PlanItemDefinition planItemDefinition = planItemDefinitions.iterator().next(); + + assertThat(planItemDefinition).isInstanceOf(HumanTask.class); + assertThat(planItemDefinition.getId()).isEqualTo("HumanTask_1"); + assertThat(planItemDefinition.getName()).isEqualTo("A HumanTask"); + + Collection planItems = casePlanModel.getPlanItems(); + + PlanItem planItem = planItems.iterator().next(); + + assertThat(planItem.getId()).isEqualTo("PI_HumanTask_1"); + assertThat(planItem.getDefinition()).isEqualTo(planItemDefinition); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ApplicabilityRuleTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ApplicabilityRuleTest.java new file mode 100644 index 00000000000..536ea76fd0f --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ApplicabilityRuleTest.java @@ -0,0 +1,45 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class ApplicabilityRuleTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(ConditionExpression.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("contextRef"), + new AttributeAssumption("name") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ArtifactTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ArtifactTest.java new file mode 100644 index 00000000000..1f525beebee --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ArtifactTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class ArtifactTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(true); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/AssociationTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/AssociationTest.java new file mode 100644 index 00000000000..1588a90a95f --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/AssociationTest.java @@ -0,0 +1,44 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class AssociationTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(Artifact.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("sourceRef"), + new AttributeAssumption("targetRef"), + new AttributeAssumption("associationDirection") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/BindingRefinementExpressionTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/BindingRefinementExpressionTest.java new file mode 100644 index 00000000000..9813b3aba17 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/BindingRefinementExpressionTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class BindingRefinementExpressionTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(Expression.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/BodyTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/BodyTest.java new file mode 100644 index 00000000000..e47e7e4b5d7 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/BodyTest.java @@ -0,0 +1,45 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.impl.CmmnModelConstants; + +/** + * @author Roman Smirnov + * + */ +public class BodyTest extends CmmnModelElementInstanceTest { + + public String getDefaultNamespace() { + return CmmnModelConstants.CMMN10_NS; + } + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemDefinitionTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemDefinitionTest.java new file mode 100644 index 00000000000..ac33492347d --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemDefinitionTest.java @@ -0,0 +1,46 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class CaseFileItemDefinitionTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(Property.class) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("name"), + new AttributeAssumption("definitionType", false, false, "http://www.omg.org/spec/CMMN/DefinitionType/Unspecified"), + new AttributeAssumption("structureRef") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemOnPartTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemOnPartTest.java new file mode 100644 index 00000000000..cbf3033da08 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemOnPartTest.java @@ -0,0 +1,44 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class CaseFileItemOnPartTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(OnPart.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(CaseFileItemTransitionStandardEvent.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("sourceRef") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemStartTriggerTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemStartTriggerTest.java new file mode 100644 index 00000000000..6d02e9feb67 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemStartTriggerTest.java @@ -0,0 +1,44 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class CaseFileItemStartTriggerTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(StartTrigger.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(CaseFileItemTransitionStandardEvent.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("sourceRef") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemTest.java new file mode 100644 index 00000000000..b32db77b2a0 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemTest.java @@ -0,0 +1,52 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.MultiplicityEnum; +import org.camunda.bpm.model.cmmn.impl.CmmnModelConstants; + +/** + * @author Roman Smirnov + * + */ +public class CaseFileItemTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(Children.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("name"), + new AttributeAssumption("multiplicity", false, false, MultiplicityEnum.Unspecified), + new AttributeAssumption("definitionRef"), + new AttributeAssumption(CmmnModelConstants.CMMN10_NS, "sourceRef"), + new AttributeAssumption("sourceRefs"), + new AttributeAssumption("targetRefs") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemTransitionStandardEventTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemTransitionStandardEventTest.java new file mode 100644 index 00000000000..e1458144a19 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseFileItemTransitionStandardEventTest.java @@ -0,0 +1,41 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstanceTest; + +/** + * @author Roman Smirnov + * + */ +public class CaseFileItemTransitionStandardEventTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseFileModelTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseFileModelTest.java new file mode 100644 index 00000000000..e2352936684 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseFileModelTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class CaseFileModelTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CaseFile.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseFileTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseFileTest.java new file mode 100644 index 00000000000..dcdc6b6a5bb --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseFileTest.java @@ -0,0 +1,42 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class CaseFileTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(CaseFileItem.class) + ); + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseParameterTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseParameterTest.java new file mode 100644 index 00000000000..d058bb2d5e4 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseParameterTest.java @@ -0,0 +1,44 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class CaseParameterTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(Parameter.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(BindingRefinementExpression.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("bindingRef") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CasePlanModelTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CasePlanModelTest.java new file mode 100644 index 00000000000..64a913b74c7 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CasePlanModelTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class CasePlanModelTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(Stage.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseRefExpressionTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseRefExpressionTest.java new file mode 100644 index 00000000000..1b9a2490389 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseRefExpressionTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class CaseRefExpressionTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(Expression.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseRoleTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseRoleTest.java new file mode 100644 index 00000000000..bd3021a157c --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseRoleTest.java @@ -0,0 +1,41 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.impl.CmmnModelConstants; + +/** + * @author Roman Smirnov + * + */ +public class CaseRoleTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnModelConstants.CMMN10_NS, Role.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseRolesTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseRolesTest.java new file mode 100644 index 00000000000..f43c615d2f7 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseRolesTest.java @@ -0,0 +1,42 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class CaseRolesTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(Role.class) + ); + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseTaskTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseTaskTest.java new file mode 100644 index 00000000000..7d1f162d7e1 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseTaskTest.java @@ -0,0 +1,49 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class CaseTaskTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(Task.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(ParameterMapping.class), + new ChildElementAssumption(CaseRefExpression.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("caseRef"), + new AttributeAssumption(CAMUNDA_NS, "caseBinding"), + new AttributeAssumption(CAMUNDA_NS, "caseVersion"), + new AttributeAssumption(CAMUNDA_NS, "caseTenantId") + ); + } +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseTest.java new file mode 100644 index 00000000000..9fcaee18a3e --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CaseTest.java @@ -0,0 +1,52 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.impl.CmmnModelConstants; + +/** + * @author Roman Smirnov + * + */ +public class CaseTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(CaseFileModel.class, 0, 1), + new ChildElementAssumption(CasePlanModel.class, 0, 1), + new ChildElementAssumption(CmmnModelConstants.CMMN10_NS, CaseRole.class), + new ChildElementAssumption(CaseRoles.class, 0, 1), + new ChildElementAssumption(InputCaseParameter.class), + new ChildElementAssumption(OutputCaseParameter.class) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("name"), + new AttributeAssumption(CmmnModelConstants.CAMUNDA_NS, "historyTimeToLive") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ChildrenTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ChildrenTest.java new file mode 100644 index 00000000000..a034a08a77b --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ChildrenTest.java @@ -0,0 +1,42 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class ChildrenTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(CaseFileItem.class) + ); + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CmmnElementTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CmmnElementTest.java new file mode 100644 index 00000000000..3a9e671b9d5 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CmmnElementTest.java @@ -0,0 +1,48 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.impl.CmmnModelConstants; + +/** + * @author Roman Smirnov + * + */ +public class CmmnElementTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(true); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(Documentation.class), + new ChildElementAssumption(ExtensionElements.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("id", true), + new AttributeAssumption(CmmnModelConstants.CMMN10_NS, "description") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CmmnModelElementInstanceTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CmmnModelElementInstanceTest.java new file mode 100644 index 00000000000..3a9f28b9aa2 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CmmnModelElementInstanceTest.java @@ -0,0 +1,43 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import org.camunda.bpm.model.cmmn.impl.CmmnModelConstants; +import org.camunda.bpm.model.cmmn.util.GetCmmnModelElementTypeRule; +import org.camunda.bpm.model.xml.test.AbstractModelElementInstanceTest; +import org.junit.BeforeClass; +import org.junit.ClassRule; + +/** + * @author Roman Smirnov + * + */ +public abstract class CmmnModelElementInstanceTest extends AbstractModelElementInstanceTest { + + @ClassRule + public static final GetCmmnModelElementTypeRule modelElementTypeRule = new GetCmmnModelElementTypeRule(); + + @BeforeClass + public static void initModelElementType() { + initModelElementType(modelElementTypeRule); + } + + public String getDefaultNamespace() { + return CmmnModelConstants.CMMN11_NS; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ConditionExpressionTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ConditionExpressionTest.java new file mode 100644 index 00000000000..b1171039feb --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ConditionExpressionTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class ConditionExpressionTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(Expression.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CriterionTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CriterionTest.java new file mode 100644 index 00000000000..c11e93d0c82 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/CriterionTest.java @@ -0,0 +1,43 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class CriterionTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, true); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("name"), + new AttributeAssumption("sentryRef") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/DecisionParameterTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/DecisionParameterTest.java new file mode 100644 index 00000000000..b9b8252086b --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/DecisionParameterTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class DecisionParameterTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(Parameter.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/DecisionRefExpressionTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/DecisionRefExpressionTest.java new file mode 100644 index 00000000000..f8f6b952979 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/DecisionRefExpressionTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class DecisionRefExpressionTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(Expression.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/DecisionTaskTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/DecisionTaskTest.java new file mode 100644 index 00000000000..bc94449c1d3 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/DecisionTaskTest.java @@ -0,0 +1,52 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class DecisionTaskTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(Task.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(ParameterMapping.class), + new ChildElementAssumption(DecisionRefExpression.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("decisionRef"), + new AttributeAssumption(CAMUNDA_NS, "resultVariable"), + new AttributeAssumption(CAMUNDA_NS, "decisionBinding"), + new AttributeAssumption(CAMUNDA_NS, "decisionVersion"), + new AttributeAssumption(CAMUNDA_NS, "mapDecisionResult"), + new AttributeAssumption(CAMUNDA_NS, "decisionTenantId") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/DecisionTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/DecisionTest.java new file mode 100644 index 00000000000..0f0ffdb496f --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/DecisionTest.java @@ -0,0 +1,46 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class DecisionTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(InputDecisionParameter.class), + new ChildElementAssumption(OutputDecisionParameter.class) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("name"), + new AttributeAssumption("implementationType", false, false, "http://www.omg.org/spec/CMMN/DecisionType/Unspecified") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/DefaultControlTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/DefaultControlTest.java new file mode 100644 index 00000000000..474896e5544 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/DefaultControlTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class DefaultControlTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(PlanItemControl.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/DefinitionsTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/DefinitionsTest.java new file mode 100644 index 00000000000..8687e4ad8c5 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/DefinitionsTest.java @@ -0,0 +1,59 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.impl.CmmnModelConstants; + +/** + * @author Roman Smirnov + * + */ +public class DefinitionsTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(Import.class), + new ChildElementAssumption(CaseFileItemDefinition.class), + new ChildElementAssumption(Case.class), + new ChildElementAssumption(Process.class), + new ChildElementAssumption(Decision.class), + new ChildElementAssumption(ExtensionElements.class, 0, 1), + new ChildElementAssumption(Relationship.class), + new ChildElementAssumption(Artifact.class) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("id", true), + new AttributeAssumption("name"), + new AttributeAssumption("targetNamespace", false, true), + new AttributeAssumption("expressionLanguage", false, false, CmmnModelConstants.XPATH_NS), + new AttributeAssumption("exporter"), + new AttributeAssumption("exporterVersion"), + new AttributeAssumption("author") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/DiscretionaryItemTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/DiscretionaryItemTest.java new file mode 100644 index 00000000000..874bc495e92 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/DiscretionaryItemTest.java @@ -0,0 +1,47 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class DiscretionaryItemTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(TableItem.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(ItemControl.class, 0, 1), + new ChildElementAssumption(EntryCriterion.class), + new ChildElementAssumption(ExitCriterion.class) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("name"), + new AttributeAssumption("definitionRef") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/DocumentationTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/DocumentationTest.java new file mode 100644 index 00000000000..74b845be990 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/DocumentationTest.java @@ -0,0 +1,43 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class DocumentationTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("id", true), + new AttributeAssumption("textFormat", false, false, "text/plain") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/EntryCriterionTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/EntryCriterionTest.java new file mode 100644 index 00000000000..e983348075d --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/EntryCriterionTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class EntryCriterionTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(Criterion.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/EventListenerTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/EventListenerTest.java new file mode 100644 index 00000000000..c572ad236c8 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/EventListenerTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class EventListenerTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(PlanItemDefinition.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/EventTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/EventTest.java new file mode 100644 index 00000000000..fb9b3d7e6d0 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/EventTest.java @@ -0,0 +1,41 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.impl.CmmnModelConstants; + +/** + * @author Roman Smirnov + * + */ +public class EventTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnModelConstants.CMMN10_NS, PlanItemDefinition.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ExitCriterionTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ExitCriterionTest.java new file mode 100644 index 00000000000..eb491194a2a --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ExitCriterionTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class ExitCriterionTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(Criterion.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ExpressionTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ExpressionTest.java new file mode 100644 index 00000000000..07c927cd265 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ExpressionTest.java @@ -0,0 +1,46 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.impl.CmmnModelConstants; + +/** + * @author Roman Smirnov + * + */ +public class ExpressionTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(CmmnModelConstants.CMMN10_NS, Body.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("language", false, false, CmmnModelConstants.XPATH_NS) + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ExtensionElementsTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ExtensionElementsTest.java new file mode 100644 index 00000000000..425c2f7db0e --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ExtensionElementsTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class ExtensionElementsTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/HumanTaskTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/HumanTaskTest.java new file mode 100644 index 00000000000..2d0fbf7a28e --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/HumanTaskTest.java @@ -0,0 +1,54 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class HumanTaskTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(Task.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(PlanningTable.class) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("performerRef"), + /** camunda extensions */ + new AttributeAssumption(CAMUNDA_NS, "assignee"), + new AttributeAssumption(CAMUNDA_NS, "candidateGroups"), + new AttributeAssumption(CAMUNDA_NS, "candidateUsers"), + new AttributeAssumption(CAMUNDA_NS, "dueDate"), + new AttributeAssumption(CAMUNDA_NS, "followUpDate"), + new AttributeAssumption(CAMUNDA_NS, "formKey"), + new AttributeAssumption(CAMUNDA_NS, "priority") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/IfPartTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/IfPartTest.java new file mode 100644 index 00000000000..d13d2ca949f --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/IfPartTest.java @@ -0,0 +1,44 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class IfPartTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(ConditionExpression.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("contextRef") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ImportTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ImportTest.java new file mode 100644 index 00000000000..aa0ec416a31 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ImportTest.java @@ -0,0 +1,44 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class ImportTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("location", false, true), + new AttributeAssumption("namespace"), + new AttributeAssumption("importType", false, true) + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/InputCaseParameterTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/InputCaseParameterTest.java new file mode 100644 index 00000000000..b8a5b26557b --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/InputCaseParameterTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class InputCaseParameterTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CaseParameter.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/InputDecisionParameterTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/InputDecisionParameterTest.java new file mode 100644 index 00000000000..a4bbc512ce7 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/InputDecisionParameterTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class InputDecisionParameterTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(DecisionParameter.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/InputProcessParameterTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/InputProcessParameterTest.java new file mode 100644 index 00000000000..ead527acc47 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/InputProcessParameterTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class InputProcessParameterTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(ProcessParameter.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/InputsCaseParameterTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/InputsCaseParameterTest.java new file mode 100644 index 00000000000..0fac3b94d4a --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/InputsCaseParameterTest.java @@ -0,0 +1,45 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.impl.CmmnModelConstants; + +/** + * @author Roman Smirnov + * + */ +public class InputsCaseParameterTest extends CmmnModelElementInstanceTest { + + public String getDefaultNamespace() { + return CmmnModelConstants.CMMN10_NS; + } + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CaseParameter.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ItemControlTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ItemControlTest.java new file mode 100644 index 00000000000..cac09d8b849 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ItemControlTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class ItemControlTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(PlanItemControl.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ManualActivationRuleTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ManualActivationRuleTest.java new file mode 100644 index 00000000000..5e9c1a2686b --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ManualActivationRuleTest.java @@ -0,0 +1,45 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class ManualActivationRuleTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(ConditionExpression.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("name"), + new AttributeAssumption("contextRef") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/MilestoneTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/MilestoneTest.java new file mode 100644 index 00000000000..891b9cd4d06 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/MilestoneTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class MilestoneTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(PlanItemDefinition.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/OnPartTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/OnPartTest.java new file mode 100644 index 00000000000..ec5471d549a --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/OnPartTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class OnPartTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, true); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/OutputCaseParameterTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/OutputCaseParameterTest.java new file mode 100644 index 00000000000..3ca764ffacc --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/OutputCaseParameterTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class OutputCaseParameterTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CaseParameter.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/OutputDecisionParameterTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/OutputDecisionParameterTest.java new file mode 100644 index 00000000000..662c23d8ee9 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/OutputDecisionParameterTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class OutputDecisionParameterTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(DecisionParameter.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/OutputProcessParameterTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/OutputProcessParameterTest.java new file mode 100644 index 00000000000..c2bd92e6d18 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/OutputProcessParameterTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class OutputProcessParameterTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(ProcessParameter.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/OutputsCaseParameterTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/OutputsCaseParameterTest.java new file mode 100644 index 00000000000..97eea79a98f --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/OutputsCaseParameterTest.java @@ -0,0 +1,45 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.impl.CmmnModelConstants; + +/** + * @author Roman Smirnov + * + */ +public class OutputsCaseParameterTest extends CmmnModelElementInstanceTest { + + public String getDefaultNamespace() { + return CmmnModelConstants.CMMN10_NS; + } + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CaseParameter.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ParameterMappingTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ParameterMappingTest.java new file mode 100644 index 00000000000..74d7430875f --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ParameterMappingTest.java @@ -0,0 +1,45 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class ParameterMappingTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(TransformationExpression.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("sourceRef"), + new AttributeAssumption("targetRef") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ParameterTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ParameterTest.java new file mode 100644 index 00000000000..00a8c8744d5 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ParameterTest.java @@ -0,0 +1,42 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class ParameterTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, true); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("name") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/PlanFragmentTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/PlanFragmentTest.java new file mode 100644 index 00000000000..7d024cda5a8 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/PlanFragmentTest.java @@ -0,0 +1,43 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class PlanFragmentTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(PlanItemDefinition.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(PlanItem.class), + new ChildElementAssumption(Sentry.class) + ); + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/PlanItemControlTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/PlanItemControlTest.java new file mode 100644 index 00000000000..3430faf0be1 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/PlanItemControlTest.java @@ -0,0 +1,44 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class PlanItemControlTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(RepetitionRule.class, 0, 1), + new ChildElementAssumption(RequiredRule.class, 0, 1), + new ChildElementAssumption(ManualActivationRule.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/PlanItemDefinitionTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/PlanItemDefinitionTest.java new file mode 100644 index 00000000000..92eeab6ddb2 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/PlanItemDefinitionTest.java @@ -0,0 +1,44 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class PlanItemDefinitionTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, true); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(DefaultControl.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("name") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/PlanItemOnPartTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/PlanItemOnPartTest.java new file mode 100644 index 00000000000..bbcdc00e81d --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/PlanItemOnPartTest.java @@ -0,0 +1,48 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.impl.CmmnModelConstants; + +/** + * @author Roman Smirnov + * + */ +public class PlanItemOnPartTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(OnPart.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(PlanItemTransitionStandardEvent.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("sourceRef"), + new AttributeAssumption(CmmnModelConstants.CMMN10_NS, "sentryRef"), + new AttributeAssumption("exitCriterionRef") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/PlanItemStartTriggerTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/PlanItemStartTriggerTest.java new file mode 100644 index 00000000000..075e45c3345 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/PlanItemStartTriggerTest.java @@ -0,0 +1,44 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class PlanItemStartTriggerTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(StartTrigger.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(PlanItemTransitionStandardEvent.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("sourceRef") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/PlanItemTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/PlanItemTest.java new file mode 100644 index 00000000000..2d8988fa7a9 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/PlanItemTest.java @@ -0,0 +1,51 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.impl.CmmnModelConstants; + +/** + * @author Roman Smirnov + * + */ +public class PlanItemTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(ItemControl.class, 0, 1), + new ChildElementAssumption(EntryCriterion.class), + new ChildElementAssumption(ExitCriterion.class) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("name"), + new AttributeAssumption("definitionRef"), + new AttributeAssumption(CmmnModelConstants.CMMN10_NS, "entryCriteriaRefs"), + new AttributeAssumption(CmmnModelConstants.CMMN10_NS, "exitCriteriaRefs") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/PlanItemTransitionStandardEventTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/PlanItemTransitionStandardEventTest.java new file mode 100644 index 00000000000..3ad3f5c571f --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/PlanItemTransitionStandardEventTest.java @@ -0,0 +1,43 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstanceTest; + +/** + * @author Roman Smirnov + * + */ +public class PlanItemTransitionStandardEventTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(false); + } + + @Override + public Collection getChildElementAssumptions() { + return null; + } + + @Override + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ProcessParameterTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ProcessParameterTest.java new file mode 100644 index 00000000000..e3547f53601 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ProcessParameterTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class ProcessParameterTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(Parameter.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ProcessRefExpressionTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ProcessRefExpressionTest.java new file mode 100644 index 00000000000..e895d633962 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ProcessRefExpressionTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class ProcessRefExpressionTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(Expression.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ProcessTaskTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ProcessTaskTest.java new file mode 100644 index 00000000000..953abefae9c --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ProcessTaskTest.java @@ -0,0 +1,50 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class ProcessTaskTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(Task.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(ParameterMapping.class), + new ChildElementAssumption(ProcessRefExpression.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("processRef"), + new AttributeAssumption(CAMUNDA_NS, "processBinding"), + new AttributeAssumption(CAMUNDA_NS, "processVersion"), + new AttributeAssumption(CAMUNDA_NS, "processTenantId") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ProcessTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ProcessTest.java new file mode 100644 index 00000000000..43d3504e4bb --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/ProcessTest.java @@ -0,0 +1,46 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class ProcessTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(InputProcessParameter.class), + new ChildElementAssumption(OutputProcessParameter.class) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("name"), + new AttributeAssumption("implementationType", false, false, "http://www.omg.org/spec/CMMN/ProcessType/Unspecified") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/PropertyTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/PropertyTest.java new file mode 100644 index 00000000000..b6f2570d362 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/PropertyTest.java @@ -0,0 +1,43 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class PropertyTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("name"), + new AttributeAssumption("type") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/RelationshipTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/RelationshipTest.java new file mode 100644 index 00000000000..a3adcfb9d1d --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/RelationshipTest.java @@ -0,0 +1,44 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + */ +public class RelationshipTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(Source.class, 1), + new ChildElementAssumption(Target.class, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("type", false, true), + new AttributeAssumption("direction") + ); + } +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/RepetitionRuleTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/RepetitionRuleTest.java new file mode 100644 index 00000000000..4c358805fa3 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/RepetitionRuleTest.java @@ -0,0 +1,48 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.impl.CmmnModelConstants; + +/** + * @author Roman Smirnov + * + */ +public class RepetitionRuleTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(ConditionExpression.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("name"), + new AttributeAssumption("contextRef"), + new AttributeAssumption(CmmnModelConstants.CAMUNDA_NS, "repeatOnStandardEvent") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/RequiredRuleTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/RequiredRuleTest.java new file mode 100644 index 00000000000..b5c335f6d82 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/RequiredRuleTest.java @@ -0,0 +1,45 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class RequiredRuleTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(ConditionExpression.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("name"), + new AttributeAssumption("contextRef") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/RoleTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/RoleTest.java new file mode 100644 index 00000000000..912d8125cc8 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/RoleTest.java @@ -0,0 +1,42 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class RoleTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("name") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/SentryTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/SentryTest.java new file mode 100644 index 00000000000..5efee496976 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/SentryTest.java @@ -0,0 +1,45 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class SentryTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(OnPart.class), + new ChildElementAssumption(IfPart.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("name") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/SourceTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/SourceTest.java new file mode 100644 index 00000000000..87b15c83d4c --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/SourceTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class SourceTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/StageTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/StageTest.java new file mode 100644 index 00000000000..9b6cc751485 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/StageTest.java @@ -0,0 +1,49 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.impl.CmmnModelConstants; + +/** + * @author Roman Smirnov + * + */ +public class StageTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(PlanFragment.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(PlanningTable.class, 0 , 1), + new ChildElementAssumption(PlanItemDefinition.class), + new ChildElementAssumption(ExitCriterion.class) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("autoComplete", false, false, Boolean.FALSE), + new AttributeAssumption(CmmnModelConstants.CMMN10_NS, "exitCriteriaRefs") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/StartTriggerTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/StartTriggerTest.java new file mode 100644 index 00000000000..3014f4d7b63 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/StartTriggerTest.java @@ -0,0 +1,38 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class StartTriggerTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, true); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/TableItemTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/TableItemTest.java new file mode 100644 index 00000000000..0647225743a --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/TableItemTest.java @@ -0,0 +1,43 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class TableItemTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnElement.class, true); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("applicabilityRuleRefs"), + new AttributeAssumption("authorizedRoleRefs") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/TargetTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/TargetTest.java new file mode 100644 index 00000000000..1e9db5174d8 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/TargetTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class TargetTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/TaskTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/TaskTest.java new file mode 100644 index 00000000000..8420ac4bb82 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/TaskTest.java @@ -0,0 +1,49 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.impl.CmmnModelConstants; + +/** + * @author Roman Smirnov + * + */ +public class TaskTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(PlanItemDefinition.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(CmmnModelConstants.CMMN10_NS, InputsCaseParameter.class), + new ChildElementAssumption(CmmnModelConstants.CMMN10_NS, OutputsCaseParameter.class), + new ChildElementAssumption(InputCaseParameter.class), + new ChildElementAssumption(OutputCaseParameter.class) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("isBlocking", false, false, Boolean.TRUE) + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/TextAnnotationTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/TextAnnotationTest.java new file mode 100644 index 00000000000..bbe248043e9 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/TextAnnotationTest.java @@ -0,0 +1,44 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class TextAnnotationTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(Artifact.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(Text.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("textFormat", false, false, "text/plain") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/TimerEventListenerTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/TimerEventListenerTest.java new file mode 100644 index 00000000000..1a1f4d7bb5f --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/TimerEventListenerTest.java @@ -0,0 +1,43 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class TimerEventListenerTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(EventListener.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(TimerExpression.class, 0, 1), + new ChildElementAssumption(StartTrigger.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/TimerEventTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/TimerEventTest.java new file mode 100644 index 00000000000..1a835dc0b64 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/TimerEventTest.java @@ -0,0 +1,45 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.impl.CmmnModelConstants; + +/** + * @author Roman Smirnov + * + */ +public class TimerEventTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnModelConstants.CMMN10_NS, Event.class, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(TimerExpression.class, 0, 1), + new ChildElementAssumption(StartTrigger.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/TransformationExpressionTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/TransformationExpressionTest.java new file mode 100644 index 00000000000..70a0daeb08c --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/TransformationExpressionTest.java @@ -0,0 +1,39 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class TransformationExpressionTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(Expression.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/UserEventListenerTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/UserEventListenerTest.java new file mode 100644 index 00000000000..3440fa23c42 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/UserEventListenerTest.java @@ -0,0 +1,42 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Arrays; +import java.util.Collection; + +/** + * @author Roman Smirnov + * + */ +public class UserEventListenerTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(EventListener.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption("authorizedRoleRefs") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/UserEventTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/UserEventTest.java new file mode 100644 index 00000000000..39bd9a7c000 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/UserEventTest.java @@ -0,0 +1,41 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.impl.CmmnModelConstants; + +/** + * @author Roman Smirnov + * + */ +public class UserEventTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CmmnModelConstants.CMMN10_NS, Event.class, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaCaseExecutionListenerTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaCaseExecutionListenerTest.java new file mode 100644 index 00000000000..694cbd5851c --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaCaseExecutionListenerTest.java @@ -0,0 +1,52 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance.camunda; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; + +import java.util.Arrays; +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstanceTest; + +/** + * @author Roman Smirnov + * + */ +public class CamundaCaseExecutionListenerTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CAMUNDA_NS, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(CAMUNDA_NS, CamundaField.class), + new ChildElementAssumption(CAMUNDA_NS, CamundaScript.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption(CAMUNDA_NS, "event"), + new AttributeAssumption(CAMUNDA_NS, "class"), + new AttributeAssumption(CAMUNDA_NS, "expression"), + new AttributeAssumption(CAMUNDA_NS, "delegateExpression") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaExpressionTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaExpressionTest.java new file mode 100644 index 00000000000..12ca8cd5ee1 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaExpressionTest.java @@ -0,0 +1,43 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance.camunda; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstanceTest; + +/** + * @author Roman Smirnov + * + */ +public class CamundaExpressionTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CAMUNDA_NS, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaFieldTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaFieldTest.java new file mode 100644 index 00000000000..2717239cea6 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaFieldTest.java @@ -0,0 +1,51 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance.camunda; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; + +import java.util.Arrays; +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstanceTest; + +/** + * @author Roman Smirnov + * + */ +public class CamundaFieldTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CAMUNDA_NS, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(CAMUNDA_NS, CamundaExpression.class, 0, 1), + new ChildElementAssumption(CAMUNDA_NS, CamundaString.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption(CAMUNDA_NS, "name"), + new AttributeAssumption(CAMUNDA_NS, "expression"), + new AttributeAssumption(CAMUNDA_NS, "stringValue") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaInTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaInTest.java new file mode 100644 index 00000000000..e0b4476c085 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaInTest.java @@ -0,0 +1,50 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance.camunda; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; + +import java.util.Arrays; +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstanceTest; + +/** + * @author Sebastian Menski + * @author Roman Smirnov + */ +public class CamundaInTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CAMUNDA_NS, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption(CAMUNDA_NS, "source"), + new AttributeAssumption(CAMUNDA_NS, "sourceExpression"), + new AttributeAssumption(CAMUNDA_NS, "variables"), + new AttributeAssumption(CAMUNDA_NS, "target"), + new AttributeAssumption(CAMUNDA_NS, "businessKey"), + new AttributeAssumption(CAMUNDA_NS, "local") + ); + } +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaOutTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaOutTest.java new file mode 100644 index 00000000000..49bdb863563 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaOutTest.java @@ -0,0 +1,49 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance.camunda; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; + +import java.util.Arrays; +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstanceTest; + + +/** + * @author Sebastian Menski + * @author Roman Smirnov + */ +public class CamundaOutTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CAMUNDA_NS, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption(CAMUNDA_NS, "source"), + new AttributeAssumption(CAMUNDA_NS, "sourceExpression"), + new AttributeAssumption(CAMUNDA_NS, "variables"), + new AttributeAssumption(CAMUNDA_NS, "target") + ); + } +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaScriptTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaScriptTest.java new file mode 100644 index 00000000000..c4488d832e0 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaScriptTest.java @@ -0,0 +1,47 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance.camunda; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; + +import java.util.Arrays; +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstanceTest; + +/** + * @author Roman Smirnov + * + */ +public class CamundaScriptTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CAMUNDA_NS, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption(CAMUNDA_NS, "scriptFormat"), + new AttributeAssumption(CAMUNDA_NS, "resource") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaStringTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaStringTest.java new file mode 100644 index 00000000000..4470e53fbdb --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaStringTest.java @@ -0,0 +1,43 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance.camunda; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstanceTest; + +/** + * @author Roman Smirnov + * + */ +public class CamundaStringTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CAMUNDA_NS, false); + } + + public Collection getChildElementAssumptions() { + return null; + } + + public Collection getAttributesAssumptions() { + return null; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaTaskListenerTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaTaskListenerTest.java new file mode 100644 index 00000000000..30cd9197b16 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaTaskListenerTest.java @@ -0,0 +1,52 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance.camunda; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; + +import java.util.Arrays; +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstanceTest; + +/** + * @author Roman Smirnov + * + */ +public class CamundaTaskListenerTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CAMUNDA_NS, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(CAMUNDA_NS, CamundaField.class), + new ChildElementAssumption(CAMUNDA_NS, CamundaScript.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption(CAMUNDA_NS, "event"), + new AttributeAssumption(CAMUNDA_NS, "class"), + new AttributeAssumption(CAMUNDA_NS, "expression"), + new AttributeAssumption(CAMUNDA_NS, "delegateExpression") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaVariableListenerTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaVariableListenerTest.java new file mode 100644 index 00000000000..29580a027d8 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaVariableListenerTest.java @@ -0,0 +1,51 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance.camunda; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; + +import java.util.Arrays; +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstanceTest; + +/** + * @author Thorben Lindhauer + */ +public class CamundaVariableListenerTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CAMUNDA_NS, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(CAMUNDA_NS, CamundaField.class), + new ChildElementAssumption(CAMUNDA_NS, CamundaScript.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption(CAMUNDA_NS, "event"), + new AttributeAssumption(CAMUNDA_NS, "class"), + new AttributeAssumption(CAMUNDA_NS, "expression"), + new AttributeAssumption(CAMUNDA_NS, "delegateExpression") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaVariableOnPartTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaVariableOnPartTest.java new file mode 100644 index 00000000000..c4eaf2978d9 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaVariableOnPartTest.java @@ -0,0 +1,50 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance.camunda; + +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CMMN11_NS; + +import java.util.Arrays; +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstanceTest; + +/** + * + * @author Deivarayan Azhagappan + * + */ +public class CamundaVariableOnPartTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CAMUNDA_NS, false); + } + + public Collection getChildElementAssumptions() { + return Arrays.asList( + new ChildElementAssumption(CAMUNDA_NS, CamundaVariableTransitionEvent.class, 0, 1) + ); + } + + public Collection getAttributesAssumptions() { + return Arrays.asList( + new AttributeAssumption(CAMUNDA_NS, "variableName") + ); + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaVariableTransitionEventTest.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaVariableTransitionEventTest.java new file mode 100644 index 00000000000..62988c1dfe0 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/instance/camunda/CamundaVariableTransitionEventTest.java @@ -0,0 +1,47 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.instance.camunda; + +import java.util.Collection; +import static org.camunda.bpm.model.cmmn.impl.CmmnModelConstants.CAMUNDA_NS; + +import org.camunda.bpm.model.cmmn.instance.CmmnModelElementInstanceTest; + +/** + * + * @author Deivarayan Azhagappan + * + */ + +public class CamundaVariableTransitionEventTest extends CmmnModelElementInstanceTest { + + public TypeAssumption getTypeAssumption() { + return new TypeAssumption(CAMUNDA_NS,false); + } + + @Override + public Collection getChildElementAssumptions() { + return null; + } + + @Override + public Collection getAttributesAssumptions() { + return null; + } + + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/util/CmmnModelResource.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/util/CmmnModelResource.java new file mode 100644 index 00000000000..2bdbf0f3306 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/util/CmmnModelResource.java @@ -0,0 +1,32 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.util; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * @author Roman Smirnov + * + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +public @interface CmmnModelResource { + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/util/GetCmmnModelElementTypeRule.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/util/GetCmmnModelElementTypeRule.java new file mode 100644 index 00000000000..7fbe4080bf3 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/util/GetCmmnModelElementTypeRule.java @@ -0,0 +1,65 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.util; + +import org.camunda.bpm.model.cmmn.Cmmn; +import org.camunda.bpm.model.xml.Model; +import org.camunda.bpm.model.xml.ModelInstance; +import org.camunda.bpm.model.xml.instance.ModelElementInstance; +import org.camunda.bpm.model.xml.test.GetModelElementTypeRule; +import org.camunda.bpm.model.xml.type.ModelElementType; +import org.junit.rules.TestWatcher; +import org.junit.runner.Description; + +/** + * @author Sebastian Menski + * @author Roman Smirnov + */ +public class GetCmmnModelElementTypeRule extends TestWatcher implements GetModelElementTypeRule { + + private ModelInstance modelInstance; + private Model model; + private ModelElementType modelElementType; + + @Override + @SuppressWarnings("unchecked") + protected void starting(Description description) { + String className = description.getClassName(); + className = className.replaceAll("Test", ""); + Class instanceClass = null; + try { + instanceClass = (Class) Class.forName(className); + } catch (ClassNotFoundException e) { + throw new RuntimeException(e); + } + modelInstance = Cmmn.createEmptyModel(); + model = modelInstance.getModel(); + modelElementType = model.getType(instanceClass); + } + + public ModelInstance getModelInstance() { + return modelInstance; + } + + public Model getModel() { + return model; + } + + public ModelElementType getModelElementType() { + return modelElementType; + } +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/util/ParseCmmnModelRule.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/util/ParseCmmnModelRule.java new file mode 100644 index 00000000000..e22d2f1e62f --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn/util/ParseCmmnModelRule.java @@ -0,0 +1,62 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn.util; + +import java.io.InputStream; + +import org.camunda.bpm.model.cmmn.Cmmn; +import org.camunda.bpm.model.cmmn.CmmnModelInstance; +import org.camunda.bpm.model.xml.impl.util.IoUtil; +import org.junit.rules.TestWatcher; +import org.junit.runner.Description; + +/** + * @author Daniel Meyer + * @author Roman Smirnov + * + */ +public class ParseCmmnModelRule extends TestWatcher { + + protected CmmnModelInstance CmmnModelInstance; + + @Override + protected void starting(Description description) { + + if(description.getAnnotation(CmmnModelResource.class) != null) { + + Class testClass = description.getTestClass(); + String methodName = description.getMethodName(); + + String resourceFolderName = testClass.getName().replaceAll("\\.", "/"); + String cmmnResourceName = resourceFolderName + "." + methodName + ".cmmn"; + + InputStream resourceAsStream = getClass().getClassLoader().getResourceAsStream(cmmnResourceName); + try { + CmmnModelInstance = Cmmn.readModelFromStream(resourceAsStream); + } finally { + IoUtil.closeSilently(resourceAsStream); + } + + } + + } + + public CmmnModelInstance getCmmnModel() { + return CmmnModelInstance; + } + +} diff --git a/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn10/Cmmn10Test.java b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn10/Cmmn10Test.java new file mode 100644 index 00000000000..11fd5be2bd3 --- /dev/null +++ b/model-api/cmmn-model/src/test/java/org/camunda/bpm/model/cmmn10/Cmmn10Test.java @@ -0,0 +1,226 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.camunda.bpm.model.cmmn10; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; + +import java.util.Collection; + +import org.camunda.bpm.model.cmmn.Cmmn; +import org.camunda.bpm.model.cmmn.CmmnModelInstance; +import org.camunda.bpm.model.cmmn.impl.CmmnModelConstants; +import org.camunda.bpm.model.cmmn.instance.Case; +import org.camunda.bpm.model.cmmn.instance.CasePlanModel; +import org.camunda.bpm.model.cmmn.instance.CaseRole; +import org.camunda.bpm.model.cmmn.instance.CaseRoles; +import org.camunda.bpm.model.cmmn.instance.ConditionExpression; +import org.camunda.bpm.model.cmmn.instance.Documentation; +import org.camunda.bpm.model.cmmn.instance.EntryCriterion; +import org.camunda.bpm.model.cmmn.instance.Event; +import org.camunda.bpm.model.cmmn.instance.EventListener; +import org.camunda.bpm.model.cmmn.instance.ExitCriterion; +import org.camunda.bpm.model.cmmn.instance.HumanTask; +import org.camunda.bpm.model.cmmn.instance.IfPart; +import org.camunda.bpm.model.cmmn.instance.InputCaseParameter; +import org.camunda.bpm.model.cmmn.instance.InputsCaseParameter; +import org.camunda.bpm.model.cmmn.instance.OutputCaseParameter; +import org.camunda.bpm.model.cmmn.instance.OutputsCaseParameter; +import org.camunda.bpm.model.cmmn.instance.PlanItem; +import org.camunda.bpm.model.cmmn.instance.Sentry; +import org.camunda.bpm.model.cmmn.instance.TimerEvent; +import org.camunda.bpm.model.cmmn.instance.UserEvent; +import org.junit.Test; + +/** + * @author Roman Smirnov + * + */ +public class Cmmn10Test { + + @Test + public void shouldGetCasePlanModelExitCriterion() { + CmmnModelInstance modelInstance = getCmmnModelInstance(); + CasePlanModel casePlanModel = modelInstance.getModelElementsByType(CasePlanModel.class).iterator().next(); + + Collection exitCriterias = casePlanModel.getExitCriterias(); + assertThat(exitCriterias).hasSize(1); + + Collection exitCriteria = casePlanModel.getExitCriteria(); + assertThat(exitCriteria).hasSize(1); + + Collection exitCriterions = casePlanModel.getExitCriterions(); + assertThat(exitCriterions).isEmpty(); + } + + @Test + public void shouldGetPlanItemExitCriterion() { + CmmnModelInstance modelInstance = getCmmnModelInstance(); + PlanItem planItem = modelInstance.getModelElementsByType(PlanItem.class).iterator().next(); + + Collection exitCriterias = planItem.getExitCriterias(); + assertThat(exitCriterias).hasSize(1); + + Collection exitCriteria = planItem.getExitCriteria(); + assertThat(exitCriteria).hasSize(1); + + Collection exitCriterions = planItem.getExitCriterions(); + assertThat(exitCriterions).isEmpty(); + } + + @Test + public void shouldGetPlanItemEntryCriterion() { + CmmnModelInstance modelInstance = getCmmnModelInstance(); + PlanItem planItem = modelInstance.getModelElementsByType(PlanItem.class).iterator().next(); + + Collection entryCriterias = planItem.getEntryCriterias(); + assertThat(entryCriterias).hasSize(1); + + Collection entryCriteria = planItem.getEntryCriteria(); + assertThat(entryCriteria).hasSize(1); + + Collection entryCriterions = planItem.getEntryCriterions(); + assertThat(entryCriterions).isEmpty(); + } + + @Test + public void shouldGetTaskInputsOutputs() { + CmmnModelInstance modelInstance = getCmmnModelInstance(); + HumanTask humanTask = modelInstance.getModelElementsByType(HumanTask.class).iterator().next(); + + Collection inputs = humanTask.getInputs(); + assertThat(inputs).hasSize(1); + + Collection inputParameters = humanTask.getInputParameters(); + assertThat(inputParameters).isEmpty(); + + Collection outputs = humanTask.getOutputs(); + assertThat(outputs).hasSize(1); + + Collection outputParameters = humanTask.getOutputParameters(); + assertThat(outputParameters).isEmpty(); + } + + @Test + public void shouldGetEvents() { + CmmnModelInstance modelInstance = getCmmnModelInstance(); + + Event event = modelInstance.getModelElementsByType(Event.class).iterator().next(); + assertThat(event).isNotNull(); + + UserEvent userEvent = modelInstance.getModelElementsByType(UserEvent.class).iterator().next(); + assertThat(userEvent).isNotNull(); + + TimerEvent timerEvent = modelInstance.getModelElementsByType(TimerEvent.class).iterator().next(); + assertThat(timerEvent).isNotNull(); + } + + @Test + public void shouldGetDescription() { + CmmnModelInstance modelInstance = getCmmnModelInstance(); + CasePlanModel casePlanModel = modelInstance.getModelElementsByType(CasePlanModel.class).iterator().next(); + + String description = casePlanModel.getDescription(); + assertThat(description).isEqualTo("This is a description..."); + + Collection documentations = casePlanModel.getDocumentations(); + assertThat(documentations).isEmpty(); + } + + @Test + public void shouldGetMultipleIfPartConditions() { + CmmnModelInstance modelInstance = getCmmnModelInstance(); + Sentry sentry = modelInstance.getModelElementsByType(Sentry.class).iterator().next(); + + IfPart ifPart = sentry.getIfPart(); + assertThat(ifPart).isNotNull(); + + Collection conditions = ifPart.getConditions(); + assertThat(conditions).hasSize(2); + + ConditionExpression condition = ifPart.getCondition(); + assertThat(condition).isNotNull(); + } + + @Test + public void shouldGetCaseRoles() { + CmmnModelInstance modelInstance = getCmmnModelInstance(); + Case _case = modelInstance.getModelElementsByType(Case.class).iterator().next(); + + Collection roles = _case.getCaseRoles(); + assertThat(roles).hasSize(2); + + CaseRoles caseRole = _case.getRoles(); + assertThat(caseRole).isNull(); + } + + @Test + public void shouldGetExpressionTextContent() { + CmmnModelInstance modelInstance = getCmmnModelInstance(); + ConditionExpression expression = modelInstance.getModelElementsByType(ConditionExpression.class).iterator().next(); + + assertThat(expression.getBody()).isEqualTo("${value >= 100}"); + assertThat(expression.getText()).isEqualTo("${value >= 100}"); + } + + @Test + public void shouldNotAbleToAddNewElement() { + CmmnModelInstance modelInstance = getCmmnModelInstance(); + CasePlanModel casePlanModel = modelInstance.getModelElementsByType(CasePlanModel.class).iterator().next(); + + HumanTask humanTask = modelInstance.newInstance(HumanTask.class); + casePlanModel.getPlanItemDefinitions().add(humanTask); + + try { + Cmmn.writeModelToStream(System.out, modelInstance); + fail("cannot save cmmn 1.0 model"); + } + catch (Exception e) { + // expected exception + } + } + + @Test + public void shouldReturnCmmn11Namespace() { + CmmnModelInstance modelInstance = getCmmnModelInstance(); + CasePlanModel casePlanModel = modelInstance.getModelElementsByType(CasePlanModel.class).iterator().next(); + + assertThat(casePlanModel.getElementType().getTypeNamespace()).isEqualTo(CmmnModelConstants.CMMN11_NS); + } + + @Test + public void shouldNotAbleToAddCmmn10Element() { + CmmnModelInstance modelInstance = Cmmn.readModelFromStream(Cmmn10Test.class.getResourceAsStream("Cmmn11Test.cmmn")); + CasePlanModel casePlanModel = modelInstance.getModelElementsByType(CasePlanModel.class).iterator().next(); + + Event event = modelInstance.newInstance(Event.class); + casePlanModel.getPlanItemDefinitions().add(event); + + try { + Cmmn.writeModelToStream(System.out, modelInstance); + fail("cannot save cmmn 1.1 model"); + } + catch (Exception e) { + // expected exception + } + } + + protected CmmnModelInstance getCmmnModelInstance() { + return Cmmn.readModelFromStream(Cmmn10Test.class.getResourceAsStream("Cmmn10Test.cmmn")); + } + +} diff --git a/model-api/cmmn-model/src/test/resources/org/camunda/bpm/model/cmmn/GenerateIdTest.cmmn b/model-api/cmmn-model/src/test/resources/org/camunda/bpm/model/cmmn/GenerateIdTest.cmmn new file mode 100644 index 00000000000..1bb67e6efc2 --- /dev/null +++ b/model-api/cmmn-model/src/test/resources/org/camunda/bpm/model/cmmn/GenerateIdTest.cmmn @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/model-api/cmmn-model/src/test/resources/org/camunda/bpm/model/cmmn/SimpleTest.shouldGetElements.cmmn b/model-api/cmmn-model/src/test/resources/org/camunda/bpm/model/cmmn/SimpleTest.shouldGetElements.cmmn new file mode 100644 index 00000000000..931b48ae440 --- /dev/null +++ b/model-api/cmmn-model/src/test/resources/org/camunda/bpm/model/cmmn/SimpleTest.shouldGetElements.cmmn @@ -0,0 +1,12 @@ + + + + + + + + + \ No newline at end of file diff --git a/model-api/cmmn-model/src/test/resources/org/camunda/bpm/model/cmmn10/Cmmn10Test.cmmn b/model-api/cmmn-model/src/test/resources/org/camunda/bpm/model/cmmn10/Cmmn10Test.cmmn new file mode 100644 index 00000000000..07693c5462e --- /dev/null +++ b/model-api/cmmn-model/src/test/resources/org/camunda/bpm/model/cmmn10/Cmmn10Test.cmmn @@ -0,0 +1,40 @@ + + + + + + + + + + + + complete + + + + ${value >= 100} + ${value >= 300} + + + + + + + + + + + + + + + + + + + + + diff --git a/model-api/cmmn-model/src/test/resources/org/camunda/bpm/model/cmmn10/Cmmn11Test.cmmn b/model-api/cmmn-model/src/test/resources/org/camunda/bpm/model/cmmn10/Cmmn11Test.cmmn new file mode 100644 index 00000000000..1bb67e6efc2 --- /dev/null +++ b/model-api/cmmn-model/src/test/resources/org/camunda/bpm/model/cmmn10/Cmmn11Test.cmmn @@ -0,0 +1,10 @@ + + + + + + + +