Commit 9d318ccf authored by Romain Bioteau's avatar Romain Bioteau
Browse files

merge

parent 7f19bc5d
......@@ -42,22 +42,11 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="condition" eType="ecore:EClass expression.ecore#//Expression"
containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Activity" eSuperTypes="#//FlowElement #//ConnectableElement #//OperationContainer">
<eClassifiers xsi:type="ecore:EClass" name="Activity" eSuperTypes="#//FlowElement #//ConnectableElement #//OperationContainer #//MultiInstantiable">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="duration" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
defaultValueLiteral="3600000"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="multiInstantiation" eType="#//MultiInstantiation"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="isLoop" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"
defaultValueLiteral="false"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="testBefore" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"
defaultValueLiteral="false"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="BoundaryIntermediateEvents"
upperBound="-1" eType="#//BoundaryEvent" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="loopCondition" eType="ecore:EClass expression.ecore#//Expression"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="loopMaximum" eType="ecore:EClass expression.ecore#//Expression"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="isMultiInstance" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Actor" eSuperTypes="#//Element">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="initiator" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
......@@ -313,21 +302,34 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="target" lowerBound="1"
eType="#//AbstractCatchMessageEvent" eOpposite="#//AbstractCatchMessageEvent/incomingMessag"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="MultiInstantiation">
<eClassifiers xsi:type="ecore:EEnum" name="MultiInstanceType">
<eLiterals name="NONE"/>
<eLiterals name="STANDARD" value="1"/>
<eLiterals name="PARALLEL" value="2"/>
<eLiterals name="SEQUENTIAL" value="3"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="MultiInstantiable" abstract="true">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="type" lowerBound="1" eType="#//MultiInstanceType"
defaultValueLiteral="NONE"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="testBefore" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"
defaultValueLiteral="false"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="loopCondition" eType="ecore:EClass expression.ecore#//Expression"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="loopMaximum" eType="ecore:EClass expression.ecore#//Expression"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="useCardinality" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
defaultValueLiteral="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="cardinality" eType="ecore:EClass expression.ecore#//Expression"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="cardinalityExpression"
eType="ecore:EClass expression.ecore#//Expression" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="collectionDataToMultiInstantiate"
eType="#//Data"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="inputData" eType="#//Data"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="iteratorExpression" eType="ecore:EClass expression.ecore#//Expression"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="outputData" eType="#//Data"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="listDataContainingOutputResults"
eType="#//Data"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="completionCondition" eType="ecore:EClass expression.ecore#//Expression"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="sequential" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
defaultValueLiteral="false"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="NonInterruptingBoundaryTimerEvent" eSuperTypes="#//BoundaryTimerEvent"/>
<eClassifiers xsi:type="ecore:EClass" name="OperationContainer">
......@@ -356,7 +358,7 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="entryRedirectionURL" eType="ecore:EClass expression.ecore#//Expression"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="entryPageFlowType" eType="#//EntryPageFlowType"
defaultValueLiteral=""/>
defaultValueLiteral="PAGEFLOW"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="entryRedirectionActions"
upperBound="-1" eType="ecore:EClass expression.ecore#//Operation" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="transmitURLAsParameter"
......@@ -409,7 +411,7 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="recapFlowConnectors" upperBound="-1"
eType="#//Connector" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="recapPageFlowType" eType="#//ConsultationPageFlowType"
defaultValueLiteral=""/>
defaultValueLiteral="PAGEFLOW"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="recapPageFlowRedirectionURL"
eType="ecore:EClass expression.ecore#//Expression" containment="true"/>
</eClassifiers>
......@@ -451,7 +453,7 @@
<eStructuralFeatures xsi:type="ecore:EAttribute" name="isDefault" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
defaultValueLiteral="false"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="conditionType" eType="#//SequenceFlowConditionType"
defaultValueLiteral="GROOVY_EXPRESSION"/>
defaultValueLiteral="EXPRESSION"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="decisionTable" lowerBound="1"
eType="#//decision/DecisionTable" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="condition" eType="ecore:EClass expression.ecore#//Expression"
......@@ -553,7 +555,7 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="viewPageFlowConnectors"
upperBound="-1" eType="#//Connector" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="viewPageFlowType" eType="#//ConsultationPageFlowType"
defaultValueLiteral=""/>
defaultValueLiteral="PAGEFLOW"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="viewPageFlowRedirectionURL"
eType="ecore:EClass expression.ecore#//Expression" containment="true"/>
</eClassifiers>
......
......@@ -6,7 +6,7 @@
dynamicTemplates="true" redirection="" forceOverwrite="true" modelName="Process"
editPluginClass="org.bonitasoft.studio.model.edit.ProcessEditPlugin" nonNLSMarkers="true"
importerID="org.eclipse.emf.importer.ecore" complianceLevel="6.0" copyrightFields="false"
editPluginID="org.bonitasoft.studio.model.edit" language="">
editPluginID="org.bonitasoft.studio.model.edit" runtimeVersion="2.9" language="">
<foreignModel>ActorMapping.ecore</foreignModel>
<foreignModel>configuration.ecore</foreignModel>
<foreignModel>connector-configuration.ecore</foreignModel>
......@@ -438,6 +438,12 @@
<genEnumLiterals ecoreEnumLiteral="process.ecore#//GatewayType/COMPLEX"/>
<genEnumLiterals ecoreEnumLiteral="process.ecore#//GatewayType/AND"/>
</genEnums>
<genEnums typeSafeEnumCompatible="false" ecoreEnum="process.ecore#//MultiInstanceType">
<genEnumLiterals ecoreEnumLiteral="process.ecore#//MultiInstanceType/NONE"/>
<genEnumLiterals ecoreEnumLiteral="process.ecore#//MultiInstanceType/STANDARD"/>
<genEnumLiterals ecoreEnumLiteral="process.ecore#//MultiInstanceType/PARALLEL"/>
<genEnumLiterals ecoreEnumLiteral="process.ecore#//MultiInstanceType/SEQUENTIAL"/>
</genEnums>
<genEnums typeSafeEnumCompatible="false" ecoreEnum="process.ecore#//SequenceFlowConditionType">
<genEnumLiterals ecoreEnumLiteral="process.ecore#//SequenceFlowConditionType/EXPRESSION"/>
<genEnumLiterals ecoreEnumLiteral="process.ecore#//SequenceFlowConditionType/DECISION_TABLE"/>
......@@ -484,13 +490,7 @@
</genClasses>
<genClasses ecoreClass="process.ecore#//Activity">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute process.ecore#//Activity/duration"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference process.ecore#//Activity/multiInstantiation"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute process.ecore#//Activity/isLoop"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute process.ecore#//Activity/testBefore"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference process.ecore#//Activity/BoundaryIntermediateEvents"/>
<genFeatures createChild="false" ecoreFeature="ecore:EReference process.ecore#//Activity/loopCondition"/>
<genFeatures createChild="false" ecoreFeature="ecore:EReference process.ecore#//Activity/loopMaximum"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute process.ecore#//Activity/isMultiInstance"/>
</genClasses>
<genClasses ecoreClass="process.ecore#//Actor">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute process.ecore#//Actor/initiator"/>
......@@ -647,15 +647,18 @@
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference process.ecore#//MessageFlow/source"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference process.ecore#//MessageFlow/target"/>
</genClasses>
<genClasses ecoreClass="process.ecore#//MultiInstantiation">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute process.ecore#//MultiInstantiation/useCardinality"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference process.ecore#//MultiInstantiation/cardinality"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference process.ecore#//MultiInstantiation/collectionDataToMultiInstantiate"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference process.ecore#//MultiInstantiation/inputData"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference process.ecore#//MultiInstantiation/outputData"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference process.ecore#//MultiInstantiation/listDataContainingOutputResults"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference process.ecore#//MultiInstantiation/completionCondition"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute process.ecore#//MultiInstantiation/sequential"/>
<genClasses image="false" ecoreClass="process.ecore#//MultiInstantiable">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute process.ecore#//MultiInstantiable/type"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute process.ecore#//MultiInstantiable/testBefore"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference process.ecore#//MultiInstantiable/loopCondition"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference process.ecore#//MultiInstantiable/loopMaximum"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute process.ecore#//MultiInstantiable/useCardinality"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference process.ecore#//MultiInstantiable/cardinalityExpression"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference process.ecore#//MultiInstantiable/collectionDataToMultiInstantiate"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference process.ecore#//MultiInstantiable/iteratorExpression"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference process.ecore#//MultiInstantiable/outputData"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference process.ecore#//MultiInstantiable/listDataContainingOutputResults"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference process.ecore#//MultiInstantiable/completionCondition"/>
</genClasses>
<genClasses ecoreClass="process.ecore#//NonInterruptingBoundaryTimerEvent"/>
<genClasses ecoreClass="process.ecore#//OperationContainer">
......
......@@ -77,7 +77,7 @@
<eStructuralFeatures xsi:type="ecore:EAttribute" name="nbInstances" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt" defaultValueLiteral="1"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="repartition" lowerBound="1"
eType="#//RepartitionType" defaultValueLiteral="0"/>
eType="#//RepartitionType" defaultValueLiteral="CONSTANT"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EEnum" name="RepartitionType">
<eLiterals name="CONSTANT" literal="CONSTANT"/>
......@@ -109,7 +109,7 @@
<eStructuralFeatures xsi:type="ecore:EAttribute" name="probability" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"
defaultValueLiteral="1"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="repartitionType" lowerBound="1"
eType="#//RepartitionType" defaultValueLiteral="0"/>
eType="#//RepartitionType" defaultValueLiteral="CONSTANT"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="SimulationDataContainer" abstract="true"
interface="true">
......
......@@ -34,7 +34,6 @@ import org.bonitasoft.studio.model.process.Data;
import org.bonitasoft.studio.model.process.Document;
import org.bonitasoft.studio.model.process.FlowElement;
import org.bonitasoft.studio.model.process.Lane;
import org.bonitasoft.studio.model.process.MultiInstantiation;
import org.bonitasoft.studio.model.process.PageFlowTransition;
import org.bonitasoft.studio.model.process.Pool;
import org.bonitasoft.studio.model.process.ProcessPackage;
......@@ -73,13 +72,13 @@ public class BonitaProcessTreeSelectionProvider {
return INSTANCE ;
}
public void fireSelectionChanged(IGraphicalEditPart ep ,EObject element){
public void fireSelectionChanged(final IGraphicalEditPart ep ,final EObject element){
TabbedPropertySheetPage page;
try {
page = getTabbedPropertySheetPage(element,ep);
if(page != null){
page.setSelectedTab(getTabIdForElement(element)) ;
for(ISection s : page.getCurrentTab().getSections()){
for(final ISection s : page.getCurrentTab().getSections()){
if(s instanceof PropertySectionWithTabs){
if(isTransientData(element)){
((PropertySectionWithTabs)s).setSelectedTab(1) ;
......@@ -89,13 +88,13 @@ public class BonitaProcessTreeSelectionProvider {
}
}
}
} catch (PartInitException e) {
} catch (final PartInitException e) {
BonitaStudioLog.error(e) ;
}
}
private String getTabIdForElement(EObject element) {
if(element instanceof FlowElement || element instanceof Connection || (element instanceof AbstractProcess && !(element instanceof Pool))){
private String getTabIdForElement(final EObject element) {
if(element instanceof FlowElement || element instanceof Connection || element instanceof AbstractProcess && !(element instanceof Pool)){
return "tab.general" ;
}else if(element instanceof Pool){
return "tab.pool" ;
......@@ -109,12 +108,11 @@ public class BonitaProcessTreeSelectionProvider {
}
}else if(element instanceof ResourceFile || element instanceof ResourceFolder){
return "tab.resource" ;
}else if((element instanceof Connector || element instanceof ConnectorParameter) && !(element.eContainingFeature().equals(ProcessPackage.eINSTANCE.getAssignable_Filters())) && !(element instanceof MultiInstantiation) && !(element.eContainer() instanceof MultiInstantiation)){
} else if ((element instanceof Connector || element instanceof ConnectorParameter)
&& !element.eContainingFeature().equals(ProcessPackage.eINSTANCE.getAssignable_Filters())) {
return "tab.connectors" ;
}else if(element instanceof Actor || element.eContainingFeature().equals(ProcessPackage.eINSTANCE.getAssignable_Filters())){
return "tab.actors" ;
}else if(element instanceof MultiInstantiation || (element instanceof Connector && element.eContainer() instanceof MultiInstantiation)){
return "tab.loop" ;
}else if(element instanceof Data){
if(isTransientData(element)){
if(element.eContainingFeature().equals(ProcessPackage.eINSTANCE.getRecapFlow_RecapTransientData())){
......@@ -128,7 +126,7 @@ public class BonitaProcessTreeSelectionProvider {
return "tab.data" ;
}
} else if(element instanceof Parameter){
return "tab.parameter";
return "tab.parameter";
} else if(element instanceof AbstractKPIBinding){
return "tab.kpi" ;
}else if(element instanceof ViewForm){
......@@ -148,23 +146,23 @@ public class BonitaProcessTreeSelectionProvider {
return "tab.forms" ;
}
} else if(element instanceof Document){
return "tab.document";
return "tab.document";
} else if(element instanceof SearchIndex){
return "tab.index";
return "tab.index";
}
return "tab.general";
}
private TabbedPropertySheetPage getTabbedPropertySheetPage(EObject element,IGraphicalEditPart ep) throws PartInitException {
private TabbedPropertySheetPage getTabbedPropertySheetPage(final EObject element,final IGraphicalEditPart ep) throws PartInitException {
IViewPart viewPart = null ;
boolean inApplicationView = displayApplicationTab(element);
for(IViewReference vr : PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getViewReferences() ){
IWorkbenchPart part = vr.getPart(true);
TabbedPropertySheetPage propertyPage = (TabbedPropertySheetPage) part.getAdapter(TabbedPropertySheetPage.class);
if(propertyPage != null){
propertyPage.selectionChanged(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(), new StructuredSelection(ep)) ;
}
if(inApplicationView){
final boolean inApplicationView = displayApplicationTab(element);
for(final IViewReference vr : PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getViewReferences() ){
final IWorkbenchPart part = vr.getPart(true);
final TabbedPropertySheetPage propertyPage = (TabbedPropertySheetPage) part.getAdapter(TabbedPropertySheetPage.class);
if(propertyPage != null){
propertyPage.selectionChanged(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(), new StructuredSelection(ep)) ;
}
if(inApplicationView){
if(vr.getId().equals("org.bonitasoft.studio.views.properties.application")){
viewPart = (IViewPart) part;
}
......@@ -181,12 +179,12 @@ public class BonitaProcessTreeSelectionProvider {
return null;
}
private boolean displayApplicationTab(EObject element) {
private boolean displayApplicationTab(final EObject element) {
return element.eClass().getEPackage().getName().equals(FormPackage.eINSTANCE.getName())
|| (element instanceof Data && isTransientData(element)) || element instanceof PageFlowTransition || element instanceof AssociatedFile || element instanceof ResourceFolder || element instanceof ResourceFile;
|| element instanceof Data && isTransientData(element) || element instanceof PageFlowTransition || element instanceof AssociatedFile || element instanceof ResourceFolder || element instanceof ResourceFile;
}
private boolean isTransientData(EObject element) {
private boolean isTransientData(final EObject element) {
return element.eContainingFeature().equals(ProcessPackage.eINSTANCE.getRecapFlow_RecapTransientData()) ||
element.eContainingFeature().equals(ProcessPackage.eINSTANCE.getViewPageFlow_ViewTransientData()) ||
element.eContainingFeature().equals(ProcessPackage.eINSTANCE.getPageFlow_TransientData()) ;
......
......@@ -178,7 +178,6 @@ public abstract class BonitaTreeViewer extends AbstractEditPartViewer implements
treeViewer.addFilter(new TextAnnotationLinkViewFilter());
treeViewer.addFilter(new EmptyExpressionViewFilter());
treeViewer.addFilter(new EmptySearchIndexViewFilter());
treeViewer.addFilter(new MultiInstanciationViewFilter());
treeViewer.addFilter(new EmptyOperationViewFilter());
}
......
/**
* Copyright (C) 2012 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/>.
*/
package org.bonitasoft.studio.common.gmf.tools.tree;
import org.bonitasoft.studio.model.process.Activity;
import org.bonitasoft.studio.model.process.MultiInstantiation;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
/**
* @author Aurelie Zara
*
*/
public class MultiInstanciationViewFilter extends ViewerFilter {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
if (element instanceof MultiInstantiation){
Activity activity = (Activity)parentElement;
if (!activity.isIsMultiInstance()){
return false;
}
}
return true;
}
}
......@@ -5,12 +5,12 @@
* 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/>.
*/
......@@ -63,7 +63,7 @@ import org.eclipse.swt.widgets.Display;
/**
* @author Romain Bioteau
*
*
*/
public class ImportBosArchiveOperation {
......
......@@ -45,7 +45,8 @@ Require-Bundle: org.eclipse.core.runtime,
org.codehaus.groovy;bundle-version="1.8.6",
org.eclipse.jdt.groovy.core,
org.codehaus.groovy.eclipse.codeassist.completion,
org.eclipse.xtext.ui
org.eclipse.xtext.ui,
org.eclipse.core.databinding.beans;bundle-version="1.2.200"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Import-Package: org.bonitasoft.engine.bpm.bar,
......
/**
* Copyright (C) 2013 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/>.
*/
......@@ -25,7 +25,7 @@ import org.bonitasoft.engine.operation.OperatorType;
/**
* @author Romain Bioteau
*
*
*/
public interface ExpressionConstants {
......@@ -94,6 +94,8 @@ public interface ExpressionConstants {
String GROUP_ITERATOR_TYPE = "GROUP_ITERATOR_TYPE";
String MULTIINSTANCE_ITERATOR_TYPE = "MULTIINSTANCE_ITERATOR_TYPE";
String QUERY_TYPE = ExpressionType.TYPE_QUERY_BUSINESS_DATA.name();
String DAO_TYPE = ExpressionType.TYPE_BUSINESS_OBJECT_DAO.name();
......
......@@ -46,7 +46,8 @@ public class ModelVersion {
public static final String VERSION_6_3_1_001 = "6.3.1-001";
public static final String VERSION_6_3_2_001 = "6.3.2-001";
public static final String VERSION_6_3_3_001 = "6.3.3-001";
public static final String CURRENT_VERSION = VERSION_6_3_3_001;
public static final String VERSION_6_4_0_001 = "6.4.0-001";
public static final String CURRENT_VERSION = VERSION_6_4_0_001;
public static boolean sameVersion(final String version) {
return CURRENT_VERSION.equals(version);
......
/**
* Copyright (C) 2014 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/>.
*/
package org.bonitasoft.studio.common.databinding;
import org.eclipse.core.databinding.observable.IObservable;
import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.core.databinding.observable.list.IObservableList;
import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory;
import org.eclipse.core.databinding.observable.masterdetail.MasterDetailObservables;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.emf.databinding.edit.EMFEditObservables;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.emf.transaction.util.TransactionUtil;
/**
* @author Romain Bioteau
*
*/
public class CustomEMFEditObservables extends EMFEditObservables {
/**
* Same as default behavior, excepted that the editing domain is retrieved on time with the target EObject
*
* @param realm
* @param value
* @param eStructuralFeature
* @return
*/
public static IObservableValue observeDetailValue(
final Realm realm,
final IObservableValue value,
final EStructuralFeature eStructuralFeature) {
return MasterDetailObservables.detailValue(value, valueFactory(realm, eStructuralFeature), eStructuralFeature);
}
public static IObservableFactory valueFactory(final Realm realm, final EStructuralFeature eStructuralFeature) {
return new IObservableFactory()
{
@Override
public IObservable createObservable(final Object target)
{
final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(target);
return observeValue(realm, editingDomain, (EObject) target, eStructuralFeature);
}
};
}
public static IObservableList observeDetailList(
final Realm realm,
final IObservableValue value,
final EStructuralFeature eStructuralFeature) {
return MasterDetailObservables.detailList(value, listFactory(realm, eStructuralFeature), eStructuralFeature);
}
public static IObservableFactory listFactory(final Realm realm, final EStructuralFeature eStructuralFeature) {
return new IObservableFactory()
{
@Override
public IObservable createObservable(final Object target)
{
final TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(target);
return observeList(realm, domain, (EObject) target, eStructuralFeature);
}
};
}
}
......@@ -19,6 +19,7 @@ package org.bonitasoft.studio.common.emf.tools;
import java.util.Collection;
import java.util.List;
import org.bonitasoft.studio.common.DataUtil;
import org.bonitasoft.studio.common.ExpressionConstants;
import org.bonitasoft.studio.common.Messages;
import org.bonitasoft.studio.model.expression.Expression;
......@@ -48,13 +49,13 @@ public class ExpressionHelper {
protected static final String EMPTY_LIST_CONTENT = "[]";
public static Expression createExpressionFromEnumType(EnumType type){
public static Expression createExpressionFromEnumType(final EnumType type){
final Expression generatedExp = ExpressionFactory.eINSTANCE.createExpression();
generatedExp.setInterpreter(ExpressionConstants.GROOVY);
generatedExp.setType(ExpressionConstants.SCRIPT_TYPE);
generatedExp.setName(type.getName() + " values");
final StringBuilder script = new StringBuilder("[");
for(String lit : type.getLiterals()){
for(final String lit : type.getLiterals()){