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