Commit 310f23ac authored by apupier's avatar apupier
Browse files

BS-12645: update model with migration and UI to include Contract on

Porcess AND Task.
parent 146d987b
......@@ -180,6 +180,10 @@
<eStructuralFeatures xsi:type="ecore:EAttribute" name="inputNames" upperBound="-1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ContractContainer" abstract="true">
<eStructuralFeatures xsi:type="ecore:EReference" name="contract" eType="#//Contract"
containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EEnum" name="ContractInputType">
<eLiterals name="TEXT"/>
<eLiterals name="INTEGER" value="1"/>
......@@ -425,7 +429,7 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="formMapping" eType="#//FormMapping"
containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Pool" eSuperTypes="#//AbstractProcess">
<eClassifiers xsi:type="ecore:EClass" name="Pool" eSuperTypes="#//AbstractProcess #//ContractContainer">
<eStructuralFeatures xsi:type="ecore:EReference" name="documents" upperBound="-1"
eType="#//Document" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="searchIndexes" upperBound="-1"
......@@ -571,13 +575,11 @@
defaultValueLiteral="GROOVY"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="SubProcessEvent" eSuperTypes="#//Container"/>
<eClassifiers xsi:type="ecore:EClass" name="Task" eSuperTypes="#//Activity #//PageFlow #//ResourceContainer #//Assignable">
<eClassifiers xsi:type="ecore:EClass" name="Task" eSuperTypes="#//Activity #//PageFlow #//ResourceContainer #//Assignable #//ContractContainer">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="overrideActorsOfTheLane"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" defaultValueLiteral="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="priority" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
defaultValueLiteral="2"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="contract" eType="#//Contract"
containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="TargetElement" abstract="true" interface="true"
eSuperTypes="#//Element">
......
......@@ -593,6 +593,9 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute process.ecore#//ContractConstraint/name"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute process.ecore#//ContractConstraint/inputNames"/>
</genClasses>
<genClasses image="false" ecoreClass="process.ecore#//ContractContainer">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference process.ecore#//ContractContainer/contract"/>
</genClasses>
<genClasses ecoreClass="process.ecore#//Connection">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference process.ecore#//Connection/target"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference process.ecore#//Connection/source"/>
......@@ -819,7 +822,6 @@
<genClasses ecoreClass="process.ecore#//Task">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute process.ecore#//Task/overrideActorsOfTheLane"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute process.ecore#//Task/priority"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference process.ecore#//Task/contract"/>
</genClasses>
<genClasses ecoreClass="process.ecore#//TargetElement">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference process.ecore#//TargetElement/incoming"/>
......
......@@ -1084,7 +1084,7 @@
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.28">
<feature
href="process.genmodel#//process/Task/contract"/>
href="process.genmodel#//process/ContractContainer/contract"/>
</initializers>
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
......@@ -3405,7 +3405,7 @@
xsi:type="gmfgen:GenFeatureSeqInitializer">
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.194">
value="//@expressionProviders/@providers.0/@expressions.195">
<feature
href="process.genmodel#//process/Element/name"/>
</initializers>
......@@ -3621,31 +3621,31 @@
xsi:type="gmfgen:GenFeatureSeqInitializer">
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.195">
value="//@expressionProviders/@providers.0/@expressions.196">
<feature
href="process.genmodel#//process/Element/name"/>
</initializers>
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.196">
value="//@expressionProviders/@providers.0/@expressions.197">
<feature
href="process.genmodel#//process/FlowElement/dynamicDescription"/>
</initializers>
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.197">
value="//@expressionProviders/@providers.0/@expressions.198">
<feature
href="process.genmodel#//process/FlowElement/dynamicLabel"/>
</initializers>
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.198">
value="//@expressionProviders/@providers.0/@expressions.199">
<feature
href="process.genmodel#//process/FlowElement/stepSummary"/>
</initializers>
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.199">
value="//@expressionProviders/@providers.0/@expressions.200">
<feature
href="process.genmodel#//process/ViewPageFlow/viewPageFlowRedirectionURL"/>
</initializers>
......@@ -3707,31 +3707,31 @@
xsi:type="gmfgen:GenFeatureSeqInitializer">
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.200">
value="//@expressionProviders/@providers.0/@expressions.201">
<feature
href="process.genmodel#//process/Element/name"/>
</initializers>
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.201">
value="//@expressionProviders/@providers.0/@expressions.202">
<feature
href="process.genmodel#//process/FlowElement/dynamicDescription"/>
</initializers>
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.202">
value="//@expressionProviders/@providers.0/@expressions.203">
<feature
href="process.genmodel#//process/FlowElement/dynamicLabel"/>
</initializers>
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.203">
value="//@expressionProviders/@providers.0/@expressions.204">
<feature
href="process.genmodel#//process/FlowElement/stepSummary"/>
</initializers>
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.204">
value="//@expressionProviders/@providers.0/@expressions.205">
<feature
href="process.genmodel#//process/ViewPageFlow/viewPageFlowRedirectionURL"/>
</initializers>
......@@ -4133,7 +4133,7 @@
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.28">
<feature
href="process.genmodel#//process/Task/contract"/>
href="process.genmodel#//process/ContractContainer/contract"/>
</initializers>
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
......@@ -5222,6 +5222,12 @@
<feature
href="process.genmodel#//process/RecapFlow/overviewFormMapping"/>
</initializers>
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.194">
<feature
href="process.genmodel#//process/ContractContainer/contract"/>
</initializers>
</modelElementInitializer>
</modelFacet>
<labels
......@@ -5863,31 +5869,31 @@
xsi:type="gmfgen:GenFeatureSeqInitializer">
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.200">
value="//@expressionProviders/@providers.0/@expressions.201">
<feature
href="process.genmodel#//process/Element/name"/>
</initializers>
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.201">
value="//@expressionProviders/@providers.0/@expressions.202">
<feature
href="process.genmodel#//process/FlowElement/dynamicDescription"/>
</initializers>
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.202">
value="//@expressionProviders/@providers.0/@expressions.203">
<feature
href="process.genmodel#//process/FlowElement/dynamicLabel"/>
</initializers>
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.203">
value="//@expressionProviders/@providers.0/@expressions.204">
<feature
href="process.genmodel#//process/FlowElement/stepSummary"/>
</initializers>
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.204">
value="//@expressionProviders/@providers.0/@expressions.205">
<feature
href="process.genmodel#//process/ViewPageFlow/viewPageFlowRedirectionURL"/>
</initializers>
......@@ -5949,31 +5955,31 @@
xsi:type="gmfgen:GenFeatureSeqInitializer">
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.195">
value="//@expressionProviders/@providers.0/@expressions.196">
<feature
href="process.genmodel#//process/Element/name"/>
</initializers>
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.196">
value="//@expressionProviders/@providers.0/@expressions.197">
<feature
href="process.genmodel#//process/FlowElement/dynamicDescription"/>
</initializers>
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.197">
value="//@expressionProviders/@providers.0/@expressions.198">
<feature
href="process.genmodel#//process/FlowElement/dynamicLabel"/>
</initializers>
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.198">
value="//@expressionProviders/@providers.0/@expressions.199">
<feature
href="process.genmodel#//process/FlowElement/stepSummary"/>
</initializers>
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.199">
value="//@expressionProviders/@providers.0/@expressions.200">
<feature
href="process.genmodel#//process/ViewPageFlow/viewPageFlowRedirectionURL"/>
</initializers>
......@@ -6661,13 +6667,13 @@
xsi:type="gmfgen:GenFeatureSeqInitializer">
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.205">
value="//@expressionProviders/@providers.0/@expressions.206">
<feature
href="process.genmodel#//process/SequenceFlow/decisionTable"/>
</initializers>
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.206">
value="//@expressionProviders/@providers.0/@expressions.207">
<feature
href="process.genmodel#//process/SequenceFlow/condition"/>
</initializers>
......@@ -6702,7 +6708,7 @@
</modelFacet>
</labels>
<creationConstraints
sourceEnd="//@expressionProviders/@providers.0/@expressions.207"/>
sourceEnd="//@expressionProviders/@providers.0/@expressions.208"/>
</links>
<links
visualID="4002"
......@@ -6732,7 +6738,7 @@
xsi:type="gmfgen:GenFeatureSeqInitializer">
<initializers
xsi:type="gmfgen:GenFeatureValueSpec"
value="//@expressionProviders/@providers.0/@expressions.208">
value="//@expressionProviders/@providers.0/@expressions.209">
<feature
href="process.genmodel#//process/Element/name"/>
</initializers>
......@@ -6768,7 +6774,7 @@
</modelFacet>
</labels>
<creationConstraints
sourceEnd="//@expressionProviders/@providers.0/@expressions.209"/>
sourceEnd="//@expressionProviders/@providers.0/@expressions.210"/>
</links>
<links
visualID="4003"
......@@ -10718,6 +10724,8 @@
body="org.bonitasoft.studio.model.process.FormMapping mapping = org.bonitasoft.studio.model.process.ProcessFactory.eINSTANCE.createFormMapping();&#xD;&#xA;mapping.setTargetForm(org.bonitasoft.studio.common.emf.tools.ExpressionHelper.createFormReferenceExpression(&quot;&quot;, &quot;&quot;));&#xD;&#xA;return mapping ;"/>
<expressions
body="org.bonitasoft.studio.model.process.FormMapping mapping = org.bonitasoft.studio.model.process.ProcessFactory.eINSTANCE.createFormMapping();&#xD;&#xA;mapping.setTargetForm(org.bonitasoft.studio.common.emf.tools.ExpressionHelper.createFormReferenceExpression(&quot;&quot;, &quot;&quot;));&#xD;&#xA;return mapping ;"/>
<expressions
body="return org.bonitasoft.studio.model.process.ProcessFactory.eINSTANCE.createContract();"/>
<expressions
body="return org.bonitasoft.studio.common.NamingUtils.getInstance(self).generateName(self, self);"/>
<expressions
......
......@@ -347,7 +347,7 @@
xsi:type="gmfmap:FeatureValueSpec">
<feature
xsi:type="ecore:EReference"
href="process.ecore#//Task/contract"/>
href="process.ecore#//ContractContainer/contract"/>
<value
body="return org.bonitasoft.studio.model.process.ProcessFactory.eINSTANCE.createContract();"
language="java"/>
......@@ -2022,6 +2022,15 @@
body="org.bonitasoft.studio.model.process.FormMapping mapping = org.bonitasoft.studio.model.process.ProcessFactory.eINSTANCE.createFormMapping();&#xD;&#xA;mapping.setTargetForm(org.bonitasoft.studio.common.emf.tools.ExpressionHelper.createFormReferenceExpression(&quot;&quot;, &quot;&quot;));&#xD;&#xA;return mapping ;"
language="java"/>
</initializers>
<initializers
xsi:type="gmfmap:FeatureValueSpec">
<feature
xsi:type="ecore:EReference"
href="process.ecore#//ContractContainer/contract"/>
<value
body="return org.bonitasoft.studio.model.process.ProcessFactory.eINSTANCE.createContract();"
language="java"/>
</initializers>
</domainInitializer>
<labelMappings
xsi:type="gmfmap:FeatureLabelMapping"
......
......@@ -9141,12 +9141,12 @@
</changes>
<changes xsi:type="history:OperationChange">
<changes xsi:type="history:Create" target="process.ecore#//Task" referenceName="eStructuralFeatures"
element="process.ecore#//Task/contract">
<changes xsi:type="history:Set" element="process.ecore#//Task/contract"
element="process.ecore#//ContractContainer/contract">
<changes xsi:type="history:Set" element="process.ecore#//ContractContainer/contract"
featureName="name" dataValue="contract"/>
<changes xsi:type="history:Set" element="process.ecore#//Task/contract"
<changes xsi:type="history:Set" element="process.ecore#//ContractContainer/contract"
featureName="containment" dataValue="true" oldDataValue="false"/>
<changes xsi:type="history:Set" element="process.ecore#//Task/contract"
<changes xsi:type="history:Set" element="process.ecore#//ContractContainer/contract"
featureName="eType" referenceValue="process.ecore#//Contract"/>
</changes>
<operation name="newReference">
......@@ -9620,5 +9620,43 @@
</changes>
</changes>
</releases>
<releases date="2015-03-17T16:47:07.422+0100" label="7.0.0-002">
<changes xsi:type="history:OperationChange">
<changes xsi:type="history:Create" target="process.ecore#/" referenceName="eClassifiers"
element="process.ecore#//ContractContainer">
<changes xsi:type="history:Set" element="process.ecore#//ContractContainer"
featureName="name" dataValue="ContractContainer"/>
<changes xsi:type="history:Set" element="process.ecore#//ContractContainer"
featureName="abstract" dataValue="true" oldDataValue="false"/>
</changes>
<changes xsi:type="history:Add" element="process.ecore#//Task" featureName="eSuperTypes"
referenceValue="process.ecore#//ContractContainer"/>
<changes xsi:type="history:Move" target="process.ecore#//ContractContainer"
referenceName="eStructuralFeatures" element="process.ecore#//ContractContainer/contract"
source="process.ecore#//Task"/>
<operation name="extractSuperClass2">
<parameters name="subClasses">
<referenceValue element="process.ecore#//Task"/>
</parameters>
<parameters name="toExtract">
<referenceValue element="process.ecore#//ContractContainer/contract"/>
</parameters>
<parameters name="ePackage">
<referenceValue element="process.ecore#/"/>
</parameters>
<parameters name="superClassName">
<dataValue>ContractContainer</dataValue>
</parameters>
<parameters name="abstr">
<dataValue>true</dataValue>
</parameters>
<parameters name="superSuperClasses"/>
</operation>
</changes>
<changes xsi:type="history:CompositeChange">
<changes xsi:type="history:Add" element="process.ecore#//Pool" featureName="eSuperTypes"
referenceValue="process.ecore#//ContractContainer"/>
</changes>
</releases>
<releases/>
</history:History>
......@@ -20,7 +20,7 @@ package org.bonitasoft.studio.common;
public class ModelVersion {
public static final String VERSION_6_0_0_ALPHA = "6.0.0-Alpha";
public static final String CURRENT_VERSION = "7.0.0-001";
public static final String CURRENT_VERSION = "7.0.0-002";
public static boolean sameVersion(final String version) {
return CURRENT_VERSION.equals(version);
......
......@@ -20,7 +20,7 @@
<propertySection
class="org.bonitasoft.studio.contract.ui.property.ContractPropertySection"
enablesFor="1"
filter="org.bonitasoft.studio.contract.ui.property.TaskFilter"
filter="org.bonitasoft.studio.contract.ui.property.ContractContainerFilter"
id="InputsSection"
tab="tab.contract"
viewID="org.bonitasoft.studio.views.properties.process.general">
......
/**
* Copyright (C) 2014 BonitaSoft S.A.
* Copyright (C) 2014-2015 BonitaSoft S.A.
* BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
......@@ -34,9 +32,9 @@ import org.mockito.runners.MockitoJUnitRunner;
*
*/
@RunWith(MockitoJUnitRunner.class)
public class TaskFilterTest {
public class ContractContainerFilterTest {
private TaskFilter filter;
private ContractContainerFilter filter;
@Mock
private IGraphicalEditPart taskEditPart;
......@@ -49,7 +47,7 @@ public class TaskFilterTest {
*/
@Before
public void setUp() throws Exception {
filter = new TaskFilter();
filter = new ContractContainerFilter();
when(taskEditPart.resolveSemanticElement()).thenReturn(ProcessFactory.eINSTANCE.createTask());
when(poolEditPart.resolveSemanticElement()).thenReturn(ProcessFactory.eINSTANCE.createPool());
}
......@@ -67,8 +65,8 @@ public class TaskFilterTest {
}
@Test
public void should_select_notaccept_PoolEditPart() throws Exception {
assertThat(filter.select(poolEditPart)).isFalse();
public void should_select_accept_PoolEditPart() throws Exception {
assertThat(filter.select(poolEditPart)).isTrue();
}
@Test
......
......@@ -59,7 +59,7 @@ public class ContractPropertySectionTest extends AbstractSWTTestCase {
private ContractPropertySection section;
@Mock
private TaskAdaptableSelectionProvider selectionProvider;
private ContractContainerAdaptableSelectionProvider selectionProvider;
@Mock
private NewFormContributionItem contributionItem;
......
......@@ -29,9 +29,9 @@ import org.bonitasoft.studio.expression.editor.provider.IExpressionEditor;
import org.bonitasoft.studio.expression.editor.provider.IExpressionProvider;
import org.bonitasoft.studio.model.expression.Expression;
import org.bonitasoft.studio.model.process.Contract;
import org.bonitasoft.studio.model.process.ContractContainer;
import org.bonitasoft.studio.model.process.ContractInput;
import org.bonitasoft.studio.model.process.FlowElement;
import org.bonitasoft.studio.model.process.Task;
import org.bonitasoft.studio.pics.Pics;
import org.eclipse.core.runtime.Assert;
import org.eclipse.emf.ecore.EObject;
......@@ -59,9 +59,9 @@ public class ContractInputExpressionProvider implements IExpressionProvider {
@Override
public Set<Expression> getExpressions(final EObject context) {
final FlowElement flowElement = ModelHelper.getParentFlowElement(context);
Assert.isLegal(flowElement instanceof Task);
Assert.isLegal(flowElement instanceof ContractContainer);
final Contract contract = ((Task) flowElement).getContract();
final Contract contract = ((ContractContainer) flowElement).getContract();
Assert.isLegal(contract != null);
final Set<Expression> result = new HashSet<Expression>();
......@@ -111,7 +111,7 @@ public class ContractInputExpressionProvider implements IExpressionProvider {
*/
@Override
public boolean isRelevantFor(final EObject context) {
return ModelHelper.getParentFlowElement(context) instanceof Task && ModelHelper.getParentForm(context) == null;
return ModelHelper.getParentFlowElement(context) instanceof ContractContainer && ModelHelper.getParentForm(context) == null;
}
/* (non-Javadoc)
......
......@@ -15,8 +15,7 @@
package org.bonitasoft.studio.contract.ui.property;
import org.bonitasoft.studio.common.jface.selection.EObjectAdaptableSelectionProvider;
import org.bonitasoft.studio.model.process.PageFlow;
import org.bonitasoft.studio.model.process.Task;
import org.bonitasoft.studio.model.process.ContractContainer;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.e4.core.di.annotations.Creatable;
import org.eclipse.emf.ecore.EObject;
......@@ -25,7 +24,7 @@ import org.eclipse.emf.ecore.EObject;
* @author Romain Bioteau
*/
@Creatable
public class TaskAdaptableSelectionProvider extends EObjectAdaptableSelectionProvider {
public class ContractContainerAdaptableSelectionProvider extends EObjectAdaptableSelectionProvider {
/*
* (non-Javadoc)
......@@ -35,14 +34,14 @@ public class TaskAdaptableSelectionProvider extends EObjectAdaptableSelectionPro
@Override
public Object getAdapter(final Class adapter) {
if (EObject.class.equals(adapter)) {
return asTask((EObject) ((IAdaptable) unwrap(selection)).getAdapter(EObject.class));
return asContractContainer((EObject) ((IAdaptable) unwrap(selection)).getAdapter(EObject.class));
}
return null;
}
private static PageFlow asTask(final EObject semanticElement) {
if (semanticElement instanceof Task) {
return (Task) semanticElement;
private static ContractContainer asContractContainer(final EObject semanticElement) {
if (semanticElement instanceof ContractContainer) {
return (ContractContainer) semanticElement;
}
return null;
}
......
......@@ -16,7 +16,8 @@
*/
package org.bonitasoft.studio.contract.ui.property;
import org.bonitasoft.studio.model.process.Task;
import org.bonitasoft.studio.model.process.ContractContainer;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.jface.viewers.IFilter;
......@@ -25,7 +26,7 @@ import org.eclipse.jface.viewers.IFilter;
* @author Romain Bioteau
*
*/
public class TaskFilter implements IFilter {
public class ContractContainerFilter implements IFilter {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IFilter#select(java.lang.Object)
......@@ -33,7 +34,8 @@ public class TaskFilter implements IFilter {
@Override
public boolean select(final Object editPart) {
if (editPart instanceof IGraphicalEditPart) {
return ((IGraphicalEditPart) editPart).resolveSemanticElement() instanceof Task;
final EObject semanticElement = ((IGraphicalEditPart) editPart).resolveSemanticElement();
return semanticElement instanceof ContractContainer;
}
return false;
}
......
......@@ -75,7 +75,7 @@ public class ContractPropertySection extends AbstractBonitaDescriptionSection {
private ContractConstraintController constraintController;
@Inject
private TaskAdaptableSelectionProvider selectionProvider;
private ContractContainerAdaptableSelectionProvider selectionProvider;
@Inject
private IEclipseContext eclipseContext;
......@@ -126,7 +126,7 @@ public class ContractPropertySection extends AbstractBonitaDescriptionSection {
final IObservableValue observeContractValue = CustomEMFEditObservables.observeDetailValue(Realm.getDefault(),
ViewersObservables.observeSingleSelection(selectionProvider),
ProcessPackage.Literals.TASK__CONTRACT);
ProcessPackage.Literals.CONTRACT_CONTAINER__CONTRACT);
observeContractValue.addValueChangeListener(new IValueChangeListener() {
@Override
......
......@@ -28,9 +28,9 @@ import org.bonitasoft.studio.contract.ui.property.constraint.edit.editor.content
import org.bonitasoft.studio.groovy.ui.viewer.GroovySourceViewerFactory;
import org.bonitasoft.studio.groovy.ui.viewer.GroovyViewer;
import org.bonitasoft.studio.model.process.ContractConstraint;
import org.bonitasoft.studio.model.process.ContractContainer;
import org.bonitasoft.studio.model.process.ContractInput;
import org.bonitasoft.studio.model.process.ProcessPackage;
import org.bonitasoft.studio.model.process.Task;
import org.eclipse.core.databinding.observable.list.IObservableList;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.emf.databinding.EMFDataBindingContext;
......@@ -116,11 +116,11 @@ public class ContractConstraintExpressionWizardPage extends WizardPage implement
protected GroovyViewer createSourceViewer(final Composite container) {
groovyViewer = groovyViewerFactory.createSourceViewer(container, editorFactory.newInstance());
Task parentTask = null;
ContractContainer contractContainer = null;
if (!inputs.isEmpty()) {