| author | Rainer Pielmann | 2012-09-19 04:04:37 (EDT) |
|---|---|---|
| committer | Stephan Born | 2012-09-19 04:04:37 (EDT) |
| commit | adba5c5ffa749ffc2801f9e8687481ab2dcfef19 (patch) (side-by-side diff) | |
| tree | c93b9b91a391b20493a2132d43aa461bdc3d93cc | |
| parent | 6b511c3efb602396a699b9d978f2b51fe1f70f64 (diff) | |
| download | org.eclipse.stardust.ide-adba5c5ffa749ffc2801f9e8687481ab2dcfef19.zip org.eclipse.stardust.ide-adba5c5ffa749ffc2801f9e8687481ab2dcfef19.tar.gz org.eclipse.stardust.ide-adba5c5ffa749ffc2801f9e8687481ab2dcfef19.tar.bz2 | |
Jira-ID: CRNT-26116
Transient Process Instance Support - Modeler functionality: Defining the persistence mode for a process definition
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ide@59334 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
9 files changed, 537 insertions, 329 deletions
diff --git a/model/org.eclipse.stardust.model.xpdl/src/org/eclipse/stardust/model/xpdl/carnot/model-messages.properties b/model/org.eclipse.stardust.model.xpdl/src/org/eclipse/stardust/model/xpdl/carnot/model-messages.properties index 3931f81..b4c00e6 100644 --- a/model/org.eclipse.stardust.model.xpdl/src/org/eclipse/stardust/model/xpdl/carnot/model-messages.properties +++ b/model/org.eclipse.stardust.model.xpdl/src/org/eclipse/stardust/model/xpdl/carnot/model-messages.properties @@ -28,7 +28,7 @@ MANUAL_ACTIVITY=Manual APPLICATION_ACTIVITY=Application
SUBPROCESS_ACTIVITY=Subprocess
JOIN_SPLIT_LOOP_AND=AND
-JOIN_SPLIT_LOOP_XOR=XOR
+JOIN_SPLIT_LOOP_XOR=XOR
JOIN_SPLIT_LOOP_NONE=None
JOIN_SPLIT_LOOP_NOLOOP=No Loop
JOIN_SPLIT_LOOP_WHILE=While
@@ -39,3 +39,6 @@ SYNC_SEPARATE=Synchronous / Separate Data ASYNC_SEPARATE=Asynchronous / Separate Data
NEW_ENTRY=<New Entry>
EXC_FAILED_INSTANTIATING_EXTENSION=Failed instantiating extension:
+AUDITTRAIL_PERSISTENCE_TRANSIENT=Transient
+AUDITTRAIL_PERSISTENCE_DEFERRED=Deferred
+AUDITTRAIL_PERSISTENCE_IMMEDIATE=Immediate
\ No newline at end of file diff --git a/model/org.eclipse.stardust.model.xpdl/src/org/eclipse/stardust/model/xpdl/carnot/util/ModelUtils.java b/model/org.eclipse.stardust.model.xpdl/src/org/eclipse/stardust/model/xpdl/carnot/util/ModelUtils.java index 5bc1d3d..b91bd22 100644 --- a/model/org.eclipse.stardust.model.xpdl/src/org/eclipse/stardust/model/xpdl/carnot/util/ModelUtils.java +++ b/model/org.eclipse.stardust.model.xpdl/src/org/eclipse/stardust/model/xpdl/carnot/util/ModelUtils.java @@ -15,11 +15,23 @@ import java.io.File; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.StringTokenizer; import javax.xml.namespace.QName; -import org.eclipse.core.resources.*; +import org.eclipse.core.resources.IContainer; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IConfigurationElement; @@ -34,27 +46,77 @@ import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.emf.ecore.util.FeatureMap; import org.eclipse.emf.ecore.xml.type.XMLTypePackage; +import org.eclipse.xsd.XSDSchema; + import org.eclipse.stardust.common.CollectionUtils; import org.eclipse.stardust.common.CompareHelper; import org.eclipse.stardust.common.StringUtils; import org.eclipse.stardust.common.reflect.Reflect; import org.eclipse.stardust.engine.api.model.PredefinedConstants; +import org.eclipse.stardust.engine.core.persistence.jdbc.transientpi.AuditTrailPersistence; import org.eclipse.stardust.engine.core.pojo.data.Type; import org.eclipse.stardust.engine.core.struct.StructuredDataConstants; -import org.eclipse.stardust.model.xpdl.carnot.*; +import org.eclipse.stardust.model.xpdl.carnot.AccessPointType; +import org.eclipse.stardust.model.xpdl.carnot.ActivityImplementationType; +import org.eclipse.stardust.model.xpdl.carnot.ActivityType; +import org.eclipse.stardust.model.xpdl.carnot.ApplicationContextTypeType; +import org.eclipse.stardust.model.xpdl.carnot.ApplicationType; +import org.eclipse.stardust.model.xpdl.carnot.ApplicationTypeType; +import org.eclipse.stardust.model.xpdl.carnot.AttributeType; +import org.eclipse.stardust.model.xpdl.carnot.CarnotWorkflowModelFactory; +import org.eclipse.stardust.model.xpdl.carnot.CarnotWorkflowModelPackage; +import org.eclipse.stardust.model.xpdl.carnot.DataMappingType; +import org.eclipse.stardust.model.xpdl.carnot.DataType; +import org.eclipse.stardust.model.xpdl.carnot.DescriptionType; +import org.eclipse.stardust.model.xpdl.carnot.DiagramType; +import org.eclipse.stardust.model.xpdl.carnot.DirectionType; +import org.eclipse.stardust.model.xpdl.carnot.DocumentRoot; +import org.eclipse.stardust.model.xpdl.carnot.EventHandlerType; +import org.eclipse.stardust.model.xpdl.carnot.IAttributeCategory; +import org.eclipse.stardust.model.xpdl.carnot.IExtensibleElement; +import org.eclipse.stardust.model.xpdl.carnot.IGraphicalObject; +import org.eclipse.stardust.model.xpdl.carnot.IIdentifiableElement; +import org.eclipse.stardust.model.xpdl.carnot.IIdentifiableModelElement; +import org.eclipse.stardust.model.xpdl.carnot.IMetaType; +import org.eclipse.stardust.model.xpdl.carnot.IModelElement; +import org.eclipse.stardust.model.xpdl.carnot.IModelElementNodeSymbol; +import org.eclipse.stardust.model.xpdl.carnot.IModelParticipant; +import org.eclipse.stardust.model.xpdl.carnot.INodeSymbol; +import org.eclipse.stardust.model.xpdl.carnot.ISymbolContainer; +import org.eclipse.stardust.model.xpdl.carnot.ITypedElement; +import org.eclipse.stardust.model.xpdl.carnot.IdRef; +import org.eclipse.stardust.model.xpdl.carnot.LaneSymbol; +import org.eclipse.stardust.model.xpdl.carnot.ModelType; +import org.eclipse.stardust.model.xpdl.carnot.Model_Messages; +import org.eclipse.stardust.model.xpdl.carnot.OrganizationType; +import org.eclipse.stardust.model.xpdl.carnot.PoolSymbol; +import org.eclipse.stardust.model.xpdl.carnot.ProcessDefinitionType; +import org.eclipse.stardust.model.xpdl.carnot.SubProcessModeType; +import org.eclipse.stardust.model.xpdl.carnot.TriggerType; +import org.eclipse.stardust.model.xpdl.carnot.TriggerTypeType; import org.eclipse.stardust.model.xpdl.carnot.spi.IDataInitializer; import org.eclipse.stardust.model.xpdl.carnot.spi.SpiExtensionRegistry; import org.eclipse.stardust.model.xpdl.util.IConnectionManager; import org.eclipse.stardust.model.xpdl.util.IObjectReference; -import org.eclipse.stardust.model.xpdl.xpdl2.*; +import org.eclipse.stardust.model.xpdl.xpdl2.BasicTypeType; import org.eclipse.stardust.model.xpdl.xpdl2.DataTypeType; +import org.eclipse.stardust.model.xpdl.xpdl2.DeclaredTypeType; +import org.eclipse.stardust.model.xpdl.xpdl2.ExtendedAttributeType; +import org.eclipse.stardust.model.xpdl.xpdl2.ExternalPackage; +import org.eclipse.stardust.model.xpdl.xpdl2.ExternalPackages; +import org.eclipse.stardust.model.xpdl.xpdl2.FormalParameterType; +import org.eclipse.stardust.model.xpdl.xpdl2.SchemaTypeType; +import org.eclipse.stardust.model.xpdl.xpdl2.TypeDeclarationType; +import org.eclipse.stardust.model.xpdl.xpdl2.TypeDeclarationsType; +import org.eclipse.stardust.model.xpdl.xpdl2.TypeType; +import org.eclipse.stardust.model.xpdl.xpdl2.XpdlFactory; +import org.eclipse.stardust.model.xpdl.xpdl2.XpdlTypeType; import org.eclipse.stardust.model.xpdl.xpdl2.util.ExtendedAttributeUtil; -import org.eclipse.xsd.XSDSchema; public class ModelUtils { private static XpdlFactory xpdlFactory = XpdlFactory.eINSTANCE; - + public static final class EObjectInvocationHandler implements InvocationHandler { private final EObject model; @@ -124,7 +186,7 @@ public class ModelUtils } return null; } - + public static DiagramType findContainingDiagram(IGraphicalObject graphicalObject) { EObject element = graphicalObject; @@ -231,7 +293,7 @@ public class ModelUtils return handler; } - + public static TriggerType findContainingTriggerType(EObject element) { TriggerType triggerType = (element instanceof TriggerType) @@ -267,12 +329,12 @@ public class ModelUtils public static long getMaxUsedOid(ModelType model) { long maxOid = 0; - + if (model.isSetOid()) { maxOid = model.getOid(); } - + for (TreeIterator<EObject> i = model.eAllContents(); i.hasNext();) { EObject obj = i.next(); @@ -283,11 +345,11 @@ public class ModelUtils } return maxOid; } - + public static ActivityType findRootActivity(ProcessDefinitionType process) { ActivityType result = null; - + for (ActivityType activity : process.getActivity()) { if (activity.getInTransitions().isEmpty()) @@ -304,23 +366,23 @@ public class ModelUtils } } } - + return result; } - + public static DataType findData(IModelElement context, String dataId) { DataType result = null; - + ModelType model = findContainingModel(context); if (null != model) { result = (DataType) findIdentifiableElement(model.getData(), dataId); } - + return result; } - + public static DescriptionType createDescription(String description) { if (description == null) @@ -337,7 +399,7 @@ public class ModelUtils { setCDataString(mixed, description, false); } - + public static void setCDataString(FeatureMap mixed, String description, boolean normalizeCrLf) { @@ -367,7 +429,7 @@ public class ModelUtils public static String getCDataString(FeatureMap featureMap) { String result = null; - + Collection<?> parts = (Collection<?>) featureMap.get( XMLTypePackage.eINSTANCE.getXMLTypeDocumentRoot_CDATA(), false); if (parts == null || parts.isEmpty()) @@ -400,7 +462,7 @@ public class ModelUtils EObject result = findElementById(parent, feature, id); return result instanceof IIdentifiableElement ? (IIdentifiableElement) result : null; } - + public static EObject findElementById(EObject parent, EStructuralFeature feature, String id) { if (parent != null) @@ -425,7 +487,7 @@ public class ModelUtils public static EObject findElementById(List<?> domain, IIdentifiableElement object) { String id = object.getId(); - + EObject result = null; for (Object candidate : domain) { @@ -450,8 +512,8 @@ public class ModelUtils { continue; } - } - + } + if(object instanceof AccessPointType) { DirectionType direction = ((AccessPointType) object).getDirection(); @@ -468,7 +530,7 @@ public class ModelUtils continue; } } - + if (CompareHelper.areEqual(id, candidateId)) { result = (EObject) candidate; @@ -476,8 +538,8 @@ public class ModelUtils } } return result; - } - + } + public static <T> T findElementById(List<? extends T> domain, String id) { T result = null; @@ -497,14 +559,14 @@ public class ModelUtils } return result; } - + public static List<ITypedElement> findMetaTypeInstances(List<? extends IModelElement> domain, String metaTypeId) { if (domain == null || domain.isEmpty()) { return Collections.emptyList(); } - + List<ITypedElement> result = CollectionUtils.newList(domain.size()); for (IModelElement element : domain) { @@ -551,7 +613,7 @@ public class ModelUtils { addSymbols(set, subContainer, ref, feat, element); } - + @SuppressWarnings("unchecked") List<INodeSymbol> list = (List<INodeSymbol>) container.eGet(ref); for (INodeSymbol symbol : list) @@ -607,12 +669,12 @@ public class ModelUtils { return getTypeDeclaration(findContainingModel(element), typeId); } - + public static TypeDeclarationType getTypeDeclaration(IModelElement element, String typeId) { return getTypeDeclaration(findContainingModel(element), typeId); } - + private static TypeDeclarationType getTypeDeclaration(ModelType model, String typeId) { return (TypeDeclarationType) findElementById(model.getTypeDeclarations().getTypeDeclaration(), typeId); @@ -694,7 +756,7 @@ public class ModelUtils if (eResource != null) { URI eUri = eResource.getURI(); - + if (eUri.isFile()) { String fileString = eUri.toFileString(); @@ -707,7 +769,7 @@ public class ModelUtils return container.getProject(); } } - + if (eUri.segmentCount() > 1) { IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember( @@ -763,7 +825,7 @@ public class ModelUtils return method.invoke(model, args); } } - + if (method.getDeclaringClass().equals(IModelElement.class)) { if (method.getName().equals("getElementOid") && model instanceof ModelType) //$NON-NLS-1$ @@ -784,7 +846,7 @@ public class ModelUtils } return null; } - + if (method.getDeclaringClass().equals(IIdentifiableModelElement.class)) { if (method.getName().equals("getDescription") && model instanceof ModelType) //$NON-NLS-1$ @@ -797,14 +859,14 @@ public class ModelUtils } return null; } - + if (method.getDeclaringClass().equals(Object.class)) { if (method.getName().equals("equals")) //$NON-NLS-1$ { return Boolean.valueOf(model.equals(args[0]) || (proxy == args[0])); } - } + } return method.invoke(model, args); } @@ -820,7 +882,7 @@ public class ModelUtils name = StringUtils.replace(name, "\u002d", "_"); //$NON-NLS-1$ //$NON-NLS-2$ name = StringUtils.replace(name, "\u0026", ""); //$NON-NLS-1$ //$NON-NLS-2$ name = StringUtils.replace(name, "\u002e", ""); //$NON-NLS-1$ //$NON-NLS-2$ - + StringBuffer sb = new StringBuffer(); StringTokenizer st = new StringTokenizer(name); while (st.hasMoreTokens()) @@ -838,7 +900,7 @@ public class ModelUtils } return sb.toString(); } - + public static void resolve(ModelType model, IExtensibleElement extensible) { // resolve internal type declarations @@ -862,7 +924,7 @@ public class ModelUtils } } } - + // resolve declared references IConfigurationElement config = SpiExtensionRegistry.getConfiguration(extensible); if (config != null) @@ -879,18 +941,18 @@ public class ModelUtils } } } - - // resolve references for Organizations which are not part of ExtensionRegistry (see CRNT-16871) + + // resolve references for Organizations which are not part of ExtensionRegistry (see CRNT-16871) if (extensible instanceof OrganizationType) { AttributeType attribute = AttributeUtil.getAttribute(extensible, PredefinedConstants.BINDING_DATA_ID_ATT); if (attribute != null) { - setReference(attribute, model, "data"); //$NON-NLS-1$ + setReference(attribute, model, "data"); //$NON-NLS-1$ } } - + // resolve permissions // TODO: make permissions a first class element IAttributeCategory category = AttributeUtil.createAttributeCategory(extensible, "authorization"); //$NON-NLS-1$ @@ -898,7 +960,7 @@ public class ModelUtils { setReference(attribute, model, "role+organization"); //$NON-NLS-1$ } - + for (Object item : extensible.eContents()) { if (item instanceof IExtensibleElement) @@ -986,9 +1048,9 @@ public class ModelUtils } return true; } - + public static ModelType parseModelType(String modelString) - { + { String modelXmlEncoding = getXmlEncoding(modelString); CarnotWorkflowModelResourceImpl resource = new CarnotWorkflowModelResourceImpl( @@ -1019,7 +1081,7 @@ public class ModelUtils throw new RuntimeException(Model_Messages.EXC_COULD_NOT_LOAD_MODEL_DOC_ROOT_NOT_FOUND); } - + private static String getXmlEncoding(String text) { String pattern = "encoding=\""; //$NON-NLS-1$ @@ -1027,14 +1089,14 @@ public class ModelUtils int pos = text.indexOf("\"", offset); //$NON-NLS-1$ return text.substring(offset, pos); } - + public static EObject getEObject(IAdaptable adaptable) { if (adaptable == null) { return null; } - + IModelElementNodeSymbol symbol = (IModelElementNodeSymbol) adaptable.getAdapter( IModelElementNodeSymbol.class); if (symbol != null) @@ -1042,8 +1104,8 @@ public class ModelUtils IModelElement modelElement = symbol.getModelElement(); return modelElement == null ? symbol : modelElement; } - - + + IModelElement modelElement = (IModelElement) adaptable.getAdapter(IModelElement.class); return modelElement == null ? ((EObject)adaptable.getAdapter(EObject.class)) : modelElement; } @@ -1075,7 +1137,7 @@ public class ModelUtils { return null; } - + Object value1 = ((EObject) prototype).eGet(feature); for (Object object : list) { @@ -1109,7 +1171,7 @@ public class ModelUtils } return null; } - + public static List<FormalParameterType> findAllFormalParameters(ModelType model) { List<FormalParameterType> result = new ArrayList<FormalParameterType>(); @@ -1124,7 +1186,7 @@ public class ModelUtils } return result; } - + public static List<String> getURIsForExternalPackages(ModelType model) { List<String> result = new ArrayList<String>(); @@ -1184,20 +1246,20 @@ public class ModelUtils public static Map<String, TypeType> getTypeMapping() { Map<String, TypeType> typeMapping; - + typeMapping = CollectionUtils.newMap(); typeMapping.put(Type.String.getId(), TypeType.STRING_LITERAL); typeMapping.put(Type.Integer.getId(), TypeType.INTEGER_LITERAL); typeMapping.put(Type.Boolean.getId(), TypeType.BOOLEAN_LITERAL); typeMapping.put(Type.Calendar.getId(), TypeType.DATETIME_LITERAL); - + return typeMapping; } - + public static DataTypeType createDataType(DataType data) { Map<String, TypeType> typeMapping = getTypeMapping(); - + DataTypeType dataType = xpdlFactory.createDataTypeType(); String typeId = data.getType().getId(); @@ -1222,7 +1284,7 @@ public class ModelUtils } return dataType; } - + public static FormalParameterType cloneFormalParameterType( FormalParameterType referencedParameterType, DataType mappedData) { @@ -1230,20 +1292,20 @@ public class ModelUtils .createFormalParameterType(); if(mappedData != null) { - parameterType.setDataType(createDataType(mappedData)); + parameterType.setDataType(createDataType(mappedData)); } else { - parameterType.setDataType((DataTypeType) EcoreUtil.copy(referencedParameterType.getDataType())); + parameterType.setDataType((DataTypeType) EcoreUtil.copy(referencedParameterType.getDataType())); } - + parameterType.setDescription(referencedParameterType.getDescription()); parameterType.setMode(referencedParameterType.getMode()); parameterType.setId(referencedParameterType.getId()); parameterType.setName(referencedParameterType.getName()); return parameterType; } - + public static boolean haveDifferentTypes(FormalParameterType type1, FormalParameterType type2) { @@ -1284,7 +1346,7 @@ public class ModelUtils } return true; } - + public static ModelType getExternalModel(ExternalPackage pack) { String uri = ExtendedAttributeUtil.getAttributeValue(pack, IConnectionManager.URI_ATTRIBUTE_NAME); @@ -1353,24 +1415,24 @@ public class ModelUtils public static String getFileSystemPath(String project, String fullPath) { IWorkspaceRoot wspRoot = ResourcesPlugin.getWorkspace().getRoot(); - + if (null != wspRoot && null != project) { IProject wspProject = wspRoot.getProject(project); if (null != wspProject && null != fullPath) { - IResource resource = wspProject.findMember(fullPath); - + IResource resource = wspProject.findMember(fullPath); + if (null != resource) { return resource.getLocation().toFile().getAbsolutePath(); } } } - + return null; } - + public static boolean hasCircularDependency(String referencingModelID, ModelType referencedModel) { @@ -1399,7 +1461,7 @@ public class ModelUtils } return false; } - + public static boolean externalPackageExists(ModelType referingModel, ModelType referencedModel) { ExternalPackages externalPackages = referingModel.getExternalPackages(); @@ -1415,7 +1477,7 @@ public class ModelUtils } return false; } - + public static List<IModelElement> findPackageReferingModelElements(ModelType referingModel, ExternalPackage externalPackage) { List<IModelElement> result = CollectionUtils.newList(); @@ -1445,7 +1507,7 @@ public class ModelUtils } return result; } - + public static String getActivityImplementationTypeText( ActivityImplementationType implementation) { @@ -1519,7 +1581,7 @@ public class ModelUtils { List<TypeDeclarationType> dataTypes = CollectionUtils.newList(); addTypeDeclarations(dataTypes, modelType); - + ExternalPackages packages = modelType.getExternalPackages(); if (packages != null) { @@ -1543,4 +1605,55 @@ public class ModelUtils dataTypes.addAll(typeDeclarations.getTypeDeclaration()); } } + + public static ArrayList<String> getPersistenceOptions(ProcessDefinitionType process) + { + ArrayList<String> list = new ArrayList<String>(); + list.add(AuditTrailPersistence.IMMEDIATE.name()); + + for (Iterator<ActivityType> i = process.getActivity().iterator(); i.hasNext();) + { + ActivityType activity = i.next(); + if (activity.getApplication() != null) + { + ApplicationType application = activity.getApplication(); + if (application.isInteractive()) + { + return list; + } + if (application.getType().getId().equals(PredefinedConstants.JMS_APPLICATION)) + { + String directionType = AttributeUtil.getAttributeValue( + (IExtensibleElement) application, "carnot:engine:type"); //$NON-NLS-1$ + if (directionType != null && !directionType.equalsIgnoreCase("out")) //$NON-NLS-1$ + { + return list; + } + } + } + } + + list.add(AuditTrailPersistence.TRANSIENT.name()); + list.add(AuditTrailPersistence.DEFERRED.name()); + + return list; + } + + public static String getPersistenceOptionsText(String value) + { + if (value.equals(AuditTrailPersistence.IMMEDIATE.name())) + { + return Model_Messages.AUDITTRAIL_PERSISTENCE_IMMEDIATE; + } + if (value.equals(AuditTrailPersistence.DEFERRED.name())) + { + return Model_Messages.AUDITTRAIL_PERSISTENCE_DEFERRED; + } + if (value.equals(AuditTrailPersistence.TRANSIENT.name())) + { + return Model_Messages.AUDITTRAIL_PERSISTENCE_TRANSIENT; + } + return null; + } + }
\ No newline at end of file diff --git a/modeling/org.eclipse.stardust.modeling.common.ui.jface/src/org/eclipse/stardust/modeling/common/ui/jface/utils/FormBuilder.java b/modeling/org.eclipse.stardust.modeling.common.ui.jface/src/org/eclipse/stardust/modeling/common/ui/jface/utils/FormBuilder.java index 9028d34..c201d62 100644 --- a/modeling/org.eclipse.stardust.modeling.common.ui.jface/src/org/eclipse/stardust/modeling/common/ui/jface/utils/FormBuilder.java +++ b/modeling/org.eclipse.stardust.modeling.common.ui.jface/src/org/eclipse/stardust/modeling/common/ui/jface/utils/FormBuilder.java @@ -16,6 +16,8 @@ import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.viewers.ArrayContentProvider; import org.eclipse.jface.viewers.ComboViewer; +import org.eclipse.jface.viewers.StructuredViewer; + import org.eclipse.stardust.modeling.common.ui.jface.widgets.LabelWithStatus; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ControlEvent; @@ -32,12 +34,12 @@ import org.eclipse.swt.widgets.*; public class FormBuilder { private static final ArrayContentProvider ARRAY_CONTENT_PROVIDER = new ArrayContentProvider(); - + public static final int DEFAULT_TEXT_FIELD_CHARS = 50; /** - * Creates a default 'label to the left of control' composite. - * + * Creates a default 'label to the left of control' composite. + * * @param parent * @return */ @@ -47,8 +49,8 @@ public class FormBuilder } /** - * Creates a default 'label to the left of control' composite. - * + * Creates a default 'label to the left of control' composite. + * * @param parent * @param nLabeledControlsColumns the number of 'labeled controls' columns (usually 1). * @return @@ -123,7 +125,7 @@ public class FormBuilder button.setLayoutData(createDefaultSingleLineWidgetGridData(span)); return button; } - + public static Group createGroup(Composite composite, String title, int numColumns) { return createGroup(composite, title, numColumns, 1); @@ -149,7 +151,7 @@ public class FormBuilder { return createList(composite, 1); } - + public static org.eclipse.swt.widgets.List createList(Composite composite, int span) { org.eclipse.swt.widgets.List list = new org.eclipse.swt.widgets.List(composite, @@ -169,12 +171,12 @@ public class FormBuilder { return createCheckBox(composite, label, 1); } - + public static Button createCheckBox(Composite composite, String label, int span) { return createCheckBox(composite, label, createDefaultButtonGridData(span)); } - + public static Button createCheckBox(Composite composite, String label, GridData gd) { Button checkBox = new Button(composite, SWT.CHECK); @@ -236,7 +238,7 @@ public class FormBuilder applyDefaultTextControlWidth(text); return text; } - + public static Tree createTree(Composite composite, int style) { Tree tree = new Tree(composite,style); @@ -262,12 +264,12 @@ public class FormBuilder tree.addControlListener(new ControlListener() { private boolean realized; - + public void controlMoved(ControlEvent e) { // ignore } - + public void controlResized(ControlEvent e) { if (!realized) @@ -285,10 +287,10 @@ public class FormBuilder } return tree; } - + /** * Creates a table with column sizes relative to table size. - * + * * @see #createTable(Composite, int, String[], int[], int, boolean) * @return */ @@ -300,13 +302,13 @@ public class FormBuilder /** * Creates a table with absolute column sizes. - * + * * @param composite * @param style * @param columnNames * @param columnSizes * @param span - * @param absoluteColumnSizes true if columnSizes are meant as absolute values, false if meant as relative values (%) of table size. + * @param absoluteColumnSizes true if columnSizes are meant as absolute values, false if meant as relative values (%) of table size. * @return */ public static Table createTable(Composite composite, int style, String[] columnNames, @@ -326,12 +328,12 @@ public class FormBuilder table.addControlListener(new ControlListener() { private boolean realized; - + public void controlMoved(ControlEvent e) { // ignore } - + public void controlResized(ControlEvent e) { if ( !realized) @@ -408,7 +410,7 @@ public class FormBuilder { return createLabelWithLeftAlignedStatus(composite, name, 1); } - + public static LabelWithStatus createLabelWithLeftAlignedStatus(Composite composite, String name, int span) { @@ -422,7 +424,7 @@ public class FormBuilder { return createLabelWithRightAlignedStatus(composite, name, 1); } - + public static LabelWithStatus createLabelWithRightAlignedStatus(Composite composite, String name, int span) { @@ -430,12 +432,12 @@ public class FormBuilder label.setLayoutData(createDefaultLabelGridData(span)); return label; } - + /** * Creates a label with right aligned status to the left of a single line text control. * <br /> * The parent is assumed contain a grid layout with standard two column layout. - * + * * @param composite * @param txtLabel * @return @@ -454,7 +456,7 @@ public class FormBuilder Text text = createText(composite, password); return new LabeledText(text, label); } - + public static LabeledText createLabeledTextLeftAlignedStatus(Composite composite, String txtLabel) { LabelWithStatus label = createLabelWithLeftAlignedStatus(composite, txtLabel); @@ -482,7 +484,7 @@ public class FormBuilder /** * Creates a label with right aligned status to the left of a combo box control. <br /> * The parent is assumed contain a grid layout with standard two column layout. - * + * * @param composite * @param txtLabel * @return @@ -497,7 +499,7 @@ public class FormBuilder /** * Creates a label with left aligned status above a multi line text control. <br /> * The parent is assumed contain a grid layout with standard two column layout. - * + * * @param composite * @param txtLabel * @return @@ -513,7 +515,7 @@ public class FormBuilder { return new GridData(SWT.FILL, SWT.CENTER, false, false); } - + public static GridData createDefaultLabelGridData(int horizonalSpan) { GridData gd = createDefaultLabelGridData(); @@ -525,7 +527,7 @@ public class FormBuilder { return new GridData(SWT.FILL, SWT.CENTER, true, false); } - + public static GridData createDefaultSingleLineWidgetGridData(int horizonalSpan) { GridData gd = createDefaultSingleLineWidgetGridData(); @@ -537,7 +539,7 @@ public class FormBuilder { return new GridData(SWT.FILL, SWT.FILL, true, true); } - + public static GridData createDefaultLimitedMultiLineWidgetGridData(int hHint) { GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true); @@ -556,21 +558,21 @@ public class FormBuilder { return new GridData(SWT.LEAD, SWT.CENTER, false, false); } - + public static GridData createDefaultButtonGridData(int horizonalSpan) { GridData gd = createDefaultButtonGridData(); gd.horizontalSpan = horizonalSpan; return gd; } - + public static void applyDefaultTextControlWidth(Control control) { Object layoutData = control.getLayoutData(); if (layoutData instanceof GridData) { ((GridData) layoutData).widthHint = FormBuilder.getDefaultTextSize(control); - } + } } public static void applyDefaultButtonWidth(Button button) @@ -581,7 +583,7 @@ public class FormBuilder Point minButtonSize = button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); ((GridData) layoutData).widthHint = Math.max( FormBuilder.getDefaultButtonSize(button.getParent()), minButtonSize.x); - } + } } public static int getDefaultTextSize(Control parent) @@ -608,7 +610,7 @@ public class FormBuilder gc.dispose(); return fontMetrics; } - + /** * @deprecated Use {@link #createDefaultSingleLineWidgetGridData()} and * {@link #applyDefaultTextControlWidth(Control)} directly. @@ -627,4 +629,13 @@ public class FormBuilder targetViewer.setInput(values); return new LabeledViewer(targetViewer, targetCombo.getLabel()); } + + public static ComboViewer createComboViewer(Composite parent, List<?> values) + { + Combo targetCombo = createCombo(parent); + ComboViewer targetViewer = new ComboViewer(targetCombo); + targetViewer.setContentProvider(ARRAY_CONTENT_PROVIDER); + targetViewer.setInput(values); + return targetViewer; + } } diff --git a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/Diagram_Messages.java b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/Diagram_Messages.java index ea146bf..527f5fc 100644 --- a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/Diagram_Messages.java +++ b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/Diagram_Messages.java @@ -145,8 +145,8 @@ public class Diagram_Messages extends NLS { public static String MSG_ConditionalPerformer; public static String MSG_Modeler; - - public static String BUT_JAXWS_CXF; + + public static String BUT_JAXWS_CXF; public static String MSG_Organization; @@ -173,7 +173,7 @@ public class Diagram_Messages extends NLS { public static String DESC_CurrentModel; public static String DESC_CarnotWizard; - + public static String NAME_StartingUser; public static String NAME_RootProcessOID; @@ -337,9 +337,9 @@ public class Diagram_Messages extends NLS { public static String WIZARD_LB_ToFile; public static String LB_NoDescriptor; - + public static String WIZARD_LB_Browse; - + public static String LB_KeyDescriptor; public static String WIZARD_LB_Select; @@ -523,9 +523,9 @@ public class Diagram_Messages extends NLS { public static String ConnectAction_ToolTip; public static String ConnectAction_WorksForConnectionType; - - public static String ConnectAction_TeamLeadConnectionType; - + + public static String ConnectAction_TeamLeadConnectionType; + public static String DIA_DO_YOU_WANT_TO_CREATE_CONNECTION_TO_ALL_SYMBOLS_NOR_TO_THE_CLOSEST_CLOSSEST_SYMBOL_ONLY; public static String DIA_MULTIPLE_CONNECTION_DETECTED; @@ -1827,11 +1827,11 @@ public class Diagram_Messages extends NLS { public static String MONTHS; public static String YEARS; - + public static String SHORT_HOURS; - + public static String SHORT_MINUTES; - + public static String SHORT_SECONDS; public static String PERIOD; @@ -2003,72 +2003,74 @@ public class Diagram_Messages extends NLS { public static String MSG_INVALID_JAXP_SETUP; public static String MSG_ANOTHER_MODEL_HIERARCHY_WITH_ID_ALREADY_EXISTS; - + public static String LBL_SELECT; - + public static String NAME_ProcessPriority; - + public static String DESC_ProcessPriority; - + public static String LBL_Incoming_Transitions; - + public static String LBL_Outgoing_Transitions; - + public static String CONFIGURATION_VARIABLE_NEW; - + public static String LBL_CATEGORY; - + public static String LBL_DATA_TYPE; - + public static String LBL_RootHierarchy; - + public static String LBL_SubHierarchy; - + public static String LBL_Participant; - - public static String QUALITY_CONTROL_LABEL; - - public static String QUALITY_CONTROL_CODES_LABEL; - + + public static String QUALITY_CONTROL_LABEL; + + public static String QUALITY_CONTROL_CODES_LABEL; + public static String QUALITY_CONTROL_ACTIVITY; - + public static String QUALITY_CONTROL_PARTICIPANT; - + public static String QUALITY_CONTROL_PROBABILITY; - + public static String QUALITY_CONTROL_FORMULA; - + public static String QUALITY_CONTROL_PROBABILITY_VALIDATION; - + public static String QUALITY_ASSURANCE_PERFORMER_VALIDATION; - + public static String QUALITY_CONTROL_CODE; - + public static String QUALITY_CONTROL_CODE_AVAILABLE; - + public static String QUALITY_CONTROL_DESCRIPTION; - + public static String QUALITY_CONTROL_VALIDATION_CODE; - + public static String QUALITY_CONTROL_VALIDATION_DUPLICATE; - - public static String QUALITY_CONTROL_VALIDATION_EMPTY; - + + public static String QUALITY_CONTROL_VALIDATION_EMPTY; + public static String CRITICALITY_TARGET_EXECUTION_TIME; - + public static String CRITICALITY_INITIAL_CRITICALITY_LOW; - + public static String CRITICALITY_INITIAL_CRITICALITY_MEDIUM; - + public static String CRITICALITY_INITIAL_CRITICALITY_HIGH; - + public static String CRITICALITY_MULTIPLE_TARGET_EXECUTION_LOW; - + public static String CRITICALITY_MULTIPLE_TARGET_EXECUTION_MEDIUM; - + public static String CRITICALITY_MULTIPLE_TARGET_EXECUTION_HIGH; - - public static String LB_OPEN_REFERENCED_MODEL; - + + public static String LB_OPEN_REFERENCED_MODEL; + public static String MSG_ProviderFileNotExists; + + public static String LBL_AUDITTRAIL_PERSISTENCE; }
\ No newline at end of file diff --git a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/diagram-messages.properties b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/diagram-messages.properties index 7448c74..a8e06b7 100644 --- a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/diagram-messages.properties +++ b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/diagram-messages.properties @@ -20,7 +20,7 @@ MSG_PASTE_NOT_POSSIBLE=Paste not possible\! MSG_ProcessDefinition={0}Process Definition: {1} MSG_ProjectNotOpen=Project ''{0}'' must be open. MSG_FolderMustExist=The chosen folder must exist. -MSG_ClearingProject=Clearing project: +MSG_ClearingProject=Clearing project: MSG_WrongFileExtension=The file extension must be "xpdl or cwm". MSG_LoadingModelFailed=Failed while trying to load the process model. MSG_FailedLoadingModel=Failed loading model @@ -45,7 +45,7 @@ MSG_DeleteVersion_Error=Error MSG_Modeler=Modeler: {0} MSG_Organization=Organization: {0} MSG_SelectProcess=Select process definition -MSG_ANOTHER_MODEL_HIERARCHY_WITH_ID_ALREADY_EXISTS=Another model hierarchy with ID: ''{0}'' already exists. +MSG_ANOTHER_MODEL_HIERARCHY_WITH_ID_ALREADY_EXISTS=Another model hierarchy with ID: ''{0}'' already exists. MSG_Role=Role: {0} MSG_Data=Data: {0} MSG_NoId=No id specified. @@ -57,7 +57,7 @@ LB_ACTION_SetData=Set Data LB_ACTION_NoLoop=Set Loop Type to No Loop LB_ACTION_SetDataPath=Set DataPath LB_ACTION_CopyVersion=Copy Version -LB_Repository_Project=Project: +LB_Repository_Project=Project: LB_Repository_Open=Open ERR_Error=Error BASENAME_Administrator=Administrator @@ -82,7 +82,7 @@ MSG_AnotherFileAlreadyExists=Another file with this name already exists. Do you MSG_SelectNewFileContainer=Select new file container MSG_ModelFileNameMustBeValid=The model file name must be valid. TASK_ANALYZING_DIFFERENCES=Analyzing differences... -TASK_Creating=Creating +TASK_Creating=Creating TASK_LOCK_ALL_ELEMENTS=Lock all elements. TASK_LOCK_ELEMENTS=Lock elements. TITLE_NewCarnotWorkflowModel=New Infinity Process Model @@ -100,7 +100,7 @@ LBL_EXTERNAL_PCK=External Package LBL_FILE_CONNECTION=Fileconnection: LBL_FILTER=Filter: LBL_HAS_NO_ID={0} has no ID. -LBL_ID=ID: +LBL_ID=ID: LBL_IMP_MD_ID=Implementation Model Id: LBL_INVOCATION_TYPE=Invocation Type LBL_LOCKED={0} (locked) @@ -131,7 +131,7 @@ LB_TraverseView_Pop=Pop LB_TraverseView_Path=Traversal Path LB_Folder=&Folder: LB_Result=''{0}'' - {1} {2} -LB_Find=Find: +LB_Find=Find: TXT_Browse=Browse... TXT_AdvancedRight=Advanced >> TXT_Author=&Author: @@ -176,7 +176,7 @@ TASK_REVERT_CHANGES=Revert changes. TASK_UNLOCK_ALL=Unlock All. LB_TraverseView_LinkedObjects=Linked Objects LB_Action_DefineStartActivity=Define Start Activity -LB_VersionRepository_Project=Project: +LB_VersionRepository_Project=Project: LB_VersionRepository_Refresh=Refresh LB_Repository_SelectionProject=Selection project DESC_ExportDiagram=Export Diagram @@ -215,7 +215,7 @@ TITLE_ModelDialog= Infinity Workflow Model TITLE_InvalidDir=Invalid directory WIZARD_MSG_SelectDiagram=Select diagram WIZARD_LB_FileFormat=File format: -LB_VersionRepository_StickyProject=Sticky Project: +LB_VersionRepository_StickyProject=Sticky Project: JOB_RepositoryUpdate=VersionRepository.Update Title_FileExists=File Already Exists BTN_Search=Search @@ -263,10 +263,10 @@ DIA_REPOSITORY_CONNECTION=Repository Connection DIA_THIS_OPERATION_REQUIRES_THE_MD_TO_BE_LOCKED_YOU_MUST_LOCK_THE_MD_TO_PROCEED=This operation requires the model to be locked.\nYou must lock the Model to proceed\! DIA_TITLE_ELEMENT_SELE=Element Selection DIAGRAM_NAME_Default=Default -DIAGRAM_NAME_Diagram=Diagram +DIAGRAM_NAME_Diagram=Diagram ERR_OpenError=Open Error ERR_duringOpeningTheEditor=En error occured during opening the editor. -ERR_UnsupportedPropertyId=Unsupported property id: +ERR_UnsupportedPropertyId=Unsupported property id: MSG_CreateFile=Create File MSG_Confirm_P1_TheFile=The file ' MSG_ConfirmDelete=Confirm Delete @@ -278,14 +278,14 @@ ERR_WorkflowModelCouldNotBeSaved=The Workflow Model could not be saved. ERR_CurrentModelCouldNotBeSaved=The current network model could not be saved. EX_SpecifiedInputNotValidModel=The specified input is not a valid Workflow Model. EX_FailedLoadingModel=Failed loading model -EX_TargetNotContained=Target is not contained in a symbol container: -EX_FailedObtainingParentToll=Failed obtaining parent pool from -EX_MissingNodeModelContainer=Missing node model container for -EX_MissingSymbolContainer=Missing symbol container for -EX_MissingNodeSymbolContainer=Missing node symbol container for +EX_TargetNotContained=Target is not contained in a symbol container: +EX_FailedObtainingParentToll=Failed obtaining parent pool from +EX_MissingNodeModelContainer=Missing node model container for +EX_MissingSymbolContainer=Missing symbol container for +EX_MissingNodeSymbolContainer=Missing node symbol container for EX_ErrorLoadingNetwork=Error loading the network. EX_MustNotMoveBendpoint=Must not move a bendpoint with this command instance. -TASKNAME_Saving=Saving +TASKNAME_Saving=Saving ERR_NoModelManagerFound=No model manager found for saving the file. ERR_NULL_SCHEMA_FOR_DECL_NULL=Null schema for TypeDeclaration ''{0}''. ERR_writingFile=Error writing file. @@ -302,8 +302,8 @@ LB_EXTMENU_New=New LB_CMD_Application=Application LB_CMD_P1_OfSource=\ (source: LB_TOOLENTRY_Route=Route -LB_ToolTip_Warning=Warning: -LB_AllMovedSymbols=All moved symbols +LB_ToolTip_Warning=Warning: +LB_AllMovedSymbols=All moved symbols LB_TOOLENTRY_Manual=Manual LB_CMD_Organization=Organization LB_RememberDecision=Remember my decision @@ -312,7 +312,7 @@ LB_PALETTEGROUP_Controls=Controls LB_CMD_TransitionOfSource=Transition (source: LB_TOOLENTRY_Application=Application LB_PALETTESTACK_Contexts=Int. Applications -LB_TOOLENTRY_P1_CreatesNew=Creates a new +LB_TOOLENTRY_P1_CreatesNew=Creates a new LB_CMD_GatewayConnectionOf=Gateway Connection ( LB_TOOLENTRY_Organization=Organization LB_EXTMENU_NewInteractiveApplication=New Interactive Application @@ -328,13 +328,13 @@ LB_CMD_P2_target=target: LB_TOOLENTRY_Role=Role LB_CreateOrganizationHierarchy=Create Organization Hierarchy LB_CreateActivity=Create Activity -LB_ToolTip_Error=Error: +LB_ToolTip_Error=Error: LB_SUBMENU_Distribute=Distribute LB_TOOLENTRY_EndEvent=End Event LB_InitiallyHibernate=Initially hibernate -LB_LastSelectedSymbol=Only the last selected symbol +LB_LastSelectedSymbol=Only the last selected symbol LB_PALETTESTACK_Data=Data -LB_GatewayOfActivity=\ Gateway (Activity: +LB_GatewayOfActivity=\ Gateway (Activity: LB_PALETTEDRAWER_Connections=Connections LB_TOOLENTRY_ProcessDefintion=Process Definition LB_PALETTEDRAWER_ProcessLifecycle=Lifecycle @@ -358,7 +358,7 @@ DESC_PALETTEDRAWER_ProcessLifecycle=Create Workflow Process Lifecycle Events DESC_TOOLENTRY_CreatesNewAnnotation=Creates a new annotation DESC_TOOLENTRY_CreatesNewTextField=Creates a new text field DESC_PALETTESTACK_CreateInteractiveApplications=Create Interactive Applications -DESC_TOOLENTRY_P1_CreatesNew=Creates a new +DESC_TOOLENTRY_P1_CreatesNew=Creates a new DESC_TOOLENTRY_P2_interactiveApplication=\ interactive application DESC_PALETTESTACK_CreateNoninteractiveApplications=Create Non-Interactive Applications LB_TOOLENTRY_P2_application=\ application @@ -387,7 +387,7 @@ DISPL_NAME_SplitMode=Split Mode BASENAME_Symbol=\ Symbol TYPE_NAME_ElementToSymbolTransfer=Element To Symbol Transfer MSG_EDITOR_unidentifiedModelElement=[unidentified model element] -LB_ID=ID: +LB_ID=ID: LB_Name=Name: LB_ShowInDiagram=Show in Diagram LB_ShowInOutline=Show in Outline @@ -454,8 +454,8 @@ MSG_ACTION_CreateActivityGraph=Select an activity as the starting point for the MSG_AN_EXTERNAL_REF_TO_THE_MD_REF_BY_THE_SEL_FILE_CONNECTION_ALREADY_EXISTS=An external reference to the model referenced by the selected file connection already exists\! MSG_OpenDiagramAction2_isInconsistent=' is inconsistent regarding control flow symbols.\r\n MSG_OpenDiagramAction3_WantToUpdate=Do you want to update it ? -EX_TargetNeitherNodeNorConnection=Target is neither a node nor a connection: -EX_RUNTIME_FoundMultipleFeatures=Found multiple features being candidates for containing +EX_TargetNeitherNodeNorConnection=Target is neither a node nor a connection: +EX_RUNTIME_FoundMultipleFeatures=Found multiple features being candidates for containing EX_isNeitherNodeNorConnectionSymbol=\ is neither a node nor a connection symbol. EX_CLASSCAST_ExpectionCompareRectangles=Expecting to compare rectangles. EXC_ALREADY_LOCKED_BY=Already locked by ({0}) @@ -466,15 +466,15 @@ EXC_CANNOT_PARSE_WSDL_FILE=Cannot parse WSDL file. EXC_CANNOT_PARSE_XSD_FILE=Cannot parse XSD file. EXC_CANNOT_RETRIEVE_TYPE_PARAMETERS=Cannot retrieve type parameters. EXC_CANNOT_SEARCH_AVAILABLE_TYPES=Cannot search available types. -EXC_ERROR_INITIALIZING_REPOSITORY_PROVIDER_FOR=Error initializing repository provider for: +EXC_ERROR_INITIALIZING_REPOSITORY_PROVIDER_FOR=Error initializing repository provider for: EXC_JOB_FAILED=Job Failed\! EXC_ORGANIZATION=Organization {0} EXC_PROJECT_IS_NOT_SHARED=Project is not shared. EXC_UNABLE_TO_FIND_LOCK_FOLDER=Unable to find lock folder. EXC_UNABLE_TO_FIND_XPDL_EXPORT_STYLESHEET=Unable to find XPDL export stylesheet. -EXC_UNABLE_TO_READ_REMONTE_MD=Unable to read remote model: {0} +EXC_UNABLE_TO_READ_REMONTE_MD=Unable to read remote model: {0} EXC_UNSUPPORTED_REPOSITORY_PROVIDER_NO_EXTENSION_FOUND_FOR=Unsupported repository provider: no extension found for: {0} -EXC_UPDATE_NEEDED_FOR=Update needed for: {0} +EXC_UPDATE_NEEDED_FOR=Update needed for: {0} EXC_USER_CANCELED_COMMIT=User Canceled Commit. EXC_USER_CANCELLED=User cancelled. LB_CMD_Data=Data @@ -595,7 +595,7 @@ MSG_NO_CHANGES=No Changes. MSG_NO_LOCKS=No Locks hold. LB_REFRESH_STATUS_JOB=Refresh Status LB_CREATE_CACHE_JOB=Create Cache -MSG_NO_COMMIT_TEXT=You must enter a Commit Text, at least 10 and up to 100 Characters. +MSG_NO_COMMIT_TEXT=You must enter a Commit Text, at least 10 and up to 100 Characters. LB_VCS_FEED_VIEW_REVISION=Revision LB_VCS_FEED_VIEW_DATE=Date LB_VCS_FEED_VIEW_AUTHOR=Author @@ -603,10 +603,10 @@ LB_VCS_FEED_VIEW_EVENT=Event LB_VCS_FEED_VIEW_COMMENT=Comment LB_DeployModel=Deploy Model LB_CompletionMethod=Completion Method: -LB_FORMBUILDER_ActionType=Action Type: +LB_FORMBUILDER_ActionType=Action Type: LB_IncludeOIDHeaderFields=Include OID header fields LB_HomeInterfaceJNDIPath=Home Interface JNDI Path: -LB_FORMBUILDER_LoopCondition=Loop Condition: +LB_FORMBUILDER_LoopCondition=Loop Condition: LB_TITLE_Join=Join LB_TITLE_Split=Split LB_MessageType=Message Type: @@ -670,8 +670,8 @@ LB_Variant=Variant: LB_User=User LB_OrganizationRoleOrUserGroup=Organization/Role or User Group CONSUME=Consume On Match -LOG=Log Handler -AUTO_BIND=Automatic Binding +LOG=Log Handler +AUTO_BIND=Automatic Binding LB_Data=Data: LB_Direction=Direction: LB_DataPath=Data Path: @@ -727,7 +727,7 @@ LB_TargetIdleTime=Target Idle Time LB_WorkingWeeksPerYear=Working Weeks Per Year LB_ActualCostPerMinute=Actual Cost Per Minute MEASURE_UNIT_EUR=EUR -LB_Cardinality=Cardinality: +LB_Cardinality=Cardinality: LB_TargetWorktimePerDay=Target (System) Worktime Per Day LB_TargetWorktimePerWeek=Target Worktime Per Week LB_TargetQueueDepth=Target Queue Depth @@ -765,7 +765,7 @@ COL_NAME_DefaultValue=Default Value COMBOBOX_Implement_Process_Interface=Implements Process Interface COMBOBOX_Provide_Process_Interface=Provides Process Interface COMBOBOX_No_Process_Interface=No Interface defined / implemented -CHECKBOX_Visibility=Visibility Public +CHECKBOX_Visibility=Visibility Public POPUP_FILECONNECTION_ADD_EXTERNAL_MODEL_REFERENCE=Add External Model Reference LABEL_EXTERNAL_MODEL_REFERENCES=External Model References LB_PROCESSINTERFACE_FORMAL_PARAMETERS=Parameters @@ -773,10 +773,10 @@ LB_PROCESSINTERFACE_REMOTE_INVOCATION=Invocation ComparableModelElementNode_root=<root> ComparableModelElementNode_noName=<no name> RANDOM_USER=Random User -PARTICIPANT=Participant -CURRENT_USER=Current User -DEFAULT_PERFORMER=Default Performer -LB_SPI_Type=Type: +PARTICIPANT=Participant +CURRENT_USER=Current User +DEFAULT_PERFORMER=Default Performer +LB_SPI_Type=Type: LB_Class=Class: LB_ClassName=Class Name: COL_NAME_Parts=Parts @@ -788,63 +788,63 @@ COL_NAME_Location=Location COL_PROCESS=Process COL_VALUE=Value LB_Location=Location: -LB_Template=Template: +LB_Template=Template: LB_JNDIPath=JNDI Path: -LB_Protocol=Protocol: +LB_Protocol=Protocol: LB_Parameter=Parameter: LB_Server=Server: -LB_XMLName=XML Type Name: +LB_XMLName=XML Type Name: LB_JSPURL=JSP URL: LB_BeanId=Bean ID: DATA_PATH=Data Path: -DATA_RADIO=Data +DATA_RADIO=Data DATA=Data: -DAYS=Days -EMAIL=EMail Address: -RUNTIME_MESSAGE=Runtime Defined Message -PREDEFINED_MESSAGE=Predefined Message +DAYS=Days +EMAIL=EMail Address: +RUNTIME_MESSAGE=Runtime Defined Message +PREDEFINED_MESSAGE=Predefined Message PROVIDE_ERROR_DUPLICATE_VARIABLE=Duplicate variable ''{0}'' PROVIDE_ERROR_IS_NOT_A_VALID_VARIABLE_NAME=''{0}'' is not a valid variable name. PROVIDE_ERROR_PROVIDE_A_VALID_NAME_FOR_NEW_VARIABLE=Provide a valid name for new variable. -ADDRESS=Predefined Address -MODEL_PARTICIPANT=Model Participant +ADDRESS=Predefined Address +MODEL_PARTICIPANT=Model Participant MODEL_ProcessInterface_InvalidForExternalInvocation= CONTENT=Mail Content: SUBJECT=Mail Subject: DEFAULT_SUBJECT=Infinity Process Platform Notification Mail -ScopeLabel=\ Scope: +ScopeLabel=\ Scope: SEND=Send Mail To: -SECS=Secs +SECS=Secs SEEN=Mark mail as seen LB_AccessPath=Access Path: LB_Addressing=Addressing: TRIGGER=Triggered Process: -LB_ConnectionFactoryJNDI=Connection Factory JNDI: +LB_ConnectionFactoryJNDI=Connection Factory JNDI: LB_HomeInterfaceClass=Home Interface Class: LB_VAR_UsernamePassword=Username / Password -LB_SPI_MessageProviderTypeClass=Message Provider: -LB_MailAction_UserPerformer=User Performer -LB_MessageAcceptor=Message Acceptor: -LB_SchemaType=Schema Type: +LB_SPI_MessageProviderTypeClass=Message Provider: +LB_MailAction_UserPerformer=User Performer +LB_MessageAcceptor=Message Acceptor: +LB_SchemaType=Schema Type: LB_Periodical=Periodical: LB_Namespace=Namespace: -LB_PartName=Name: -LB_Exception=Exception: +LB_PartName=Name: +LB_Exception=Exception: LB_Constructor=Constructor: LB_ElementName=Element Name: LB_Periodicity=Periodicity: LB_DefaultValue=Default Value: LB_SPI_LocalBinding=Local Binding: LB_HomeInterface=Home Interface: -LB_BodyPredicate=Body Predicate: -LB_MailboxAction=Mailbox Action: +LB_BodyPredicate=Body Predicate: +LB_MailboxAction=Mailbox Action: LB_StopTimestamp=Stop Timestamp: LB_IMPL_GenericResource=Generic Resource NAME_PROVIDER_DefaultProvider=Default provider BASENAME_Content=Content BASENAME_InAccessPoint=In Access Point BASENAME_OutAccessPoint=Out Access Point -LB_Id=Id: +LB_Id=Id: NAME_ACCEPTOR_Default=Default acceptor NAME_ACCESSPOINT_Exception=Exception NAME_ACCESSPOINT_TimeStamp=Time stamp @@ -855,12 +855,12 @@ LB_MECH_WSSecurity=WS-Security LB_PrimaryKeyClass=Primary Key Class: CHECKBOX_LocalBinding=Local Binding CHECKBOX_Required=Required -LB_SenderPredicates=Sender Predicate: -LB_SubjectPredicate=Subject Predicate: -LB_CandidateMails=Candidate Mails: +LB_SenderPredicates=Sender Predicate: +LB_SubjectPredicate=Subject Predicate: +LB_CandidateMails=Candidate Mails: LB_IMPL_CarnotSpecific= Infinity Specific LB_MECH_HttpBasicAuthorization=HTTP Basic Authorization -LB_TypeDeclarationURL=Type Declaration URL: +LB_TypeDeclarationURL=Type Declaration URL: LB_VAR_UsernamePasswordDigest=Username / Password Digest AP_WSAddressingEndpointReference=WS-Addressing EndpointReference AP_Authentication=Authentication @@ -875,12 +875,12 @@ ELEMENT_Output=Output ELEMENT_Faults=Faults ELEMENT_TypeMappings=Type Mappings ELEMENT_XMLTemplates=XML Templates -B_RADIO_CompletedEvent=Completed Event -B_RADIO_application=application -B_RADIO_suspended=suspended -B_RADIO_hibernated=hibernated -B_RADIO_interrupted=interrupted -B_RADIO_completed=completed +B_RADIO_CompletedEvent=Completed Event +B_RADIO_application=application +B_RADIO_suspended=suspended +B_RADIO_hibernated=hibernated +B_RADIO_interrupted=interrupted +B_RADIO_completed=completed B_RADIO_StateChangeEvent=State Change Event SOURCE_STATE=Source State INTERRUPTED=Interrupted @@ -898,24 +898,24 @@ BOX_SUBPROCESS_IS_RESOLVED_AT_RUNTIME=Subprocess is resolved at runtime. BOX_TXT_APPLY_TO_ALL_INVALID_ID_S=Apply to all invalid IDs. BOX_TXT_APPLY_TO_ALL_MISSING_ID_S=Apply to all missing IDs. BOX_TXT_APPLY_TO_ALL_SIMILAR_ISSUES_IN_THIS_MD=Apply to all similar issues in this model. -BOX_TXT_PREFIX_ID_WITH=Prefix ID with: -BOX_TXT_REPLACE_INVALID_CHARACTERS_WITH=Replace invalid characters with: +BOX_TXT_PREFIX_ID_WITH=Prefix ID with: +BOX_TXT_REPLACE_INVALID_CHARACTERS_WITH=Replace invalid characters with: GROUP_SourceState=Source State GROUP_ServerSettings=Server Settings GROUP_MailSettings=Mail Settings USE=Use: -MINS=Mins -HOURS=Hours -MONTHS=Months -YEARS=Years +MINS=Mins +HOURS=Hours +MONTHS=Months +YEARS=Years PERIOD=Period: MSG_TestURL=Test URL MSG_THIS_OPERATION_MAY_RESULT_IN_DANGLING_REFE=This operation may result in dangling references. MSG_THIS_OPERATION_WILL_REMOVE_ALL_REFERENCES_TO_NULL_FROM_MODEL=This operation will remove all references to ''{0}'' from the model. MSG_TXT_ID_CONTAINS_INVALID_CHARACTERS=\ ID contains invalid characters. MSG_TXT_ID_IS_NOT_VALID=\ ID is not valid. -MSG_SuccessfullyConnectedTo=Successfully connected to -MSG_ConnectionTo=Connection to +MSG_SuccessfullyConnectedTo=Successfully connected to +MSG_ConnectionTo=Connection to MSG_Failed=\ failed\! TXT_LINK=Link TXT_OLD_MD_FORMAT=Old Model Format @@ -942,7 +942,7 @@ EXISTING=All existing mails PARAMETER_MAPPING_TABLE_LABEL=Parameter Mapping TXT_undefined=[undefined] HIBERNATED=Hibernated -SUSPENDED=Suspended +SUSPENDED=Suspended INTENDED_STATE_CHANGE=Intended State Change PlainJavaPropertyPage_LB_Plain_Java=Plain Java Application Class PlainJavaPropertyPage_LB_Method=Method @@ -986,7 +986,7 @@ NameIdDialog_Warning_NameExists=Name already exists in Model\! FileCopyMessage_Title=XSD-files must be copied into target project! FileUpdateMessage_Title=XSD-files must be updated! FileCopyMessage_Text=Could not find the following files!\n -MSG_Replace_performer_with_performer_for_activity=Replace performer {0} with performer {1} for activity {2} ? +MSG_Replace_performer_with_performer_for_activity=Replace performer {0} with performer {1} for activity {2} ? BOX_ORGANIZATION_SUPPORTS_DEPARTMENT=Organization supports department MSG_REMOVE_PERFORMER_FROM_MANUAL_TRIGGER=Remove performer ''{0}'' from manual trigger ''{1}'' ? MSG_RPLACE_PERFORMER_WITH_PERFORMER_FOR_TRIGGER=Replace performer ''{0}'' with performer ''{1}'' for trigger ''{2}'' ? @@ -1031,4 +1031,5 @@ CRITICALITY_MULTIPLE_TARGET_EXECUTION_LOW=Multiple of target execution time (Low CRITICALITY_MULTIPLE_TARGET_EXECUTION_MEDIUM=Multiple of target execution time (Medium) CRITICALITY_MULTIPLE_TARGET_EXECUTION_HIGH=Multiple of target execution time (High) LB_OPEN_REFERENCED_MODEL=Open referenced Model? -MSG_ProviderFileNotExists=Provider File does not exists.
\ No newline at end of file +MSG_ProviderFileNotExists=Provider File does not exists. +LBL_AUDITTRAIL_PERSISTENCE=Audit Trail Persistence
\ No newline at end of file diff --git a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/properties/ProcessDefinitionGeneralPropertyPage.java b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/properties/ProcessDefinitionGeneralPropertyPage.java index d0f9a8e..770ba98 100644 --- a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/properties/ProcessDefinitionGeneralPropertyPage.java +++ b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/properties/ProcessDefinitionGeneralPropertyPage.java @@ -10,6 +10,12 @@ *******************************************************************************/ package org.eclipse.stardust.modeling.core.properties; +import java.util.ArrayList; + +import org.eclipse.jface.viewers.ComboViewer; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.widgets.Button; @@ -22,6 +28,7 @@ import org.eclipse.stardust.model.xpdl.carnot.IModelElement; import org.eclipse.stardust.model.xpdl.carnot.IModelElementNodeSymbol; import org.eclipse.stardust.model.xpdl.carnot.ProcessDefinitionType; import org.eclipse.stardust.model.xpdl.carnot.util.AttributeUtil; +import org.eclipse.stardust.model.xpdl.carnot.util.ModelUtils; import org.eclipse.stardust.modeling.common.ui.jface.utils.FormBuilder; import org.eclipse.stardust.modeling.common.ui.jface.utils.LabeledText; import org.eclipse.stardust.modeling.core.Diagram_Messages; @@ -29,30 +36,40 @@ import org.eclipse.stardust.modeling.core.Diagram_Messages; public class ProcessDefinitionGeneralPropertyPage extends IdentifiablePropertyPage { private static final int DEFAULT_PRIORITY = 1; - + private LabeledText priorityText; - private Button transientCheckBox; + private Button auditTrailPersistenceCheckBox; + + private String auditTrailPersistence = null; + + private ComboViewer comboViewer; - private boolean isTransient = false; + private boolean isAuditTrailPersistent; public void loadFieldsFromElement(IModelElementNodeSymbol symbol, IModelElement element) { super.loadFieldsFromElement(symbol, element); ProcessDefinitionType pd = (ProcessDefinitionType) element; priorityText.getText().setText(Integer.toString(pd.getDefaultPriority())); - - AttributeType transientAttribute = AttributeUtil.getAttribute( + + AttributeType auditTrailPersistenceAttribute = AttributeUtil.getAttribute( (IExtensibleElement) getModelElement(), - "carnot:engine:transientProcessExecutionSupport"); + "carnot:engine:auditTrailPersistence"); //$NON-NLS-1$ - if (transientAttribute != null) + if (auditTrailPersistenceAttribute != null) { - isTransient = AttributeUtil.getBooleanValue(transientAttribute); + auditTrailPersistence = AttributeUtil.getAttributeValue( + (IExtensibleElement) getModelElement(), + "carnot:engine:auditTrailPersistence"); //$NON-NLS-1$ + auditTrailPersistenceCheckBox.setSelection(true); + isAuditTrailPersistent = true; + comboViewer.setSelection(new StructuredSelection(auditTrailPersistence)); } - transientCheckBox.setSelection(isTransient); + + comboViewer.getCombo().setEnabled(isAuditTrailPersistent); } - + public void loadElementFromFields(IModelElementNodeSymbol symbol, IModelElement element) { super.loadElementFromFields(symbol, element); @@ -73,6 +90,13 @@ public class ProcessDefinitionGeneralPropertyPage extends IdentifiablePropertyPa { // nothing to do here, maybe log an error } + + if ( !isAuditTrailPersistent) + { + AttributeUtil.setAttribute((IExtensibleElement) modelElement, + "carnot:engine:auditTrailPersistence", null); //$NON-NLS-1$ + + } } public void contributeExtraControls(Composite composite) @@ -80,28 +104,47 @@ public class ProcessDefinitionGeneralPropertyPage extends IdentifiablePropertyPa priorityText = FormBuilder.createLabeledText(composite, Diagram_Messages.LBL_TXT_DEFAULT_PRIORITY); - transientCheckBox = FormBuilder.createCheckBox(composite, "Transient", 2); - transientCheckBox.addSelectionListener(new SelectionAdapter() + auditTrailPersistenceCheckBox = FormBuilder.createCheckBox(composite, + Diagram_Messages.LBL_AUDITTRAIL_PERSISTENCE, 1); //$NON-NLS-1$ + + ArrayList<String> list = ModelUtils.getPersistenceOptions((ProcessDefinitionType) getModelElement()); + + comboViewer = FormBuilder.createComboViewer(composite, list); + comboViewer.getCombo().addSelectionListener(new SelectionAdapter() + { + + public void widgetSelected(SelectionEvent e) + { + + IStructuredSelection value = (IStructuredSelection) comboViewer.getSelection(); + AttributeUtil.setAttribute((IExtensibleElement) modelElement, + "carnot:engine:auditTrailPersistence", value.getFirstElement() //$NON-NLS-1$ + .toString()); + } + }); + + comboViewer.setLabelProvider(new LabelProvider() + { + + public String getText(Object element) + { + return ModelUtils.getPersistenceOptionsText(element.toString()); + } + + }); + + auditTrailPersistenceCheckBox.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { - AttributeUtil.setBooleanAttribute((IExtensibleElement) modelElement, - "carnot:engine:transientProcessExecutionSupport", true); - isTransient = !isTransient; - if (isTransient) - { - AttributeUtil.setBooleanAttribute((IExtensibleElement) modelElement, - "carnot:engine:transientProcessExecutionSupport", true); - } - else - { - AttributeUtil.setBooleanAttribute((IExtensibleElement) modelElement, - "carnot:engine:transientProcessExecutionSupport", false); - } + isAuditTrailPersistent = !isAuditTrailPersistent; + comboViewer.getCombo().setEnabled(isAuditTrailPersistent); } }); } + + } diff --git a/modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/Validation_Messages.java b/modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/Validation_Messages.java index 8eef4f8..94c9359 100644 --- a/modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/Validation_Messages.java +++ b/modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/Validation_Messages.java @@ -48,51 +48,51 @@ public class Validation_Messages extends NLS public static String MODEL_TooLongId; public static String MODEL_ValidFromAfterValidTo; - + public static String MODEL_ConfigurationVariable_NeverUsed; - + public static String MODEL_ConfigurationVariable_Invalid; - + public static String MODEL_ConfigurationVariable_NoDefaultValue; - + public static String MODEL_ConfigurationVariable_NotAllowed; - + public static String MODEL_ConfigurationVariable_NAME; - + public static String MODEL_ConfigurationVariable_ID; - + public static String MODEL_ConfigurationVariable_TypeDec; - + public static String MODEL_ConfigurationVariable_Description; - + public static String MODEL_Connection_NoConnection; - + public static String MODEL_ReferencedModel_NoModel; - + public static String MODEL_ExternalPackage_IDConflict; - + public static String MODEL_ReferencedType_NotFound; - + public static String MODEL_ReferencedType_NotVisible; - + public static String MODEL_ProcessInterface_NotValid; - + public static String MODEL_ProcessInterface_InvalidForExternalInvocation; - + public static String MODEL_ProcessInterface_Multiple_Implementations; - + public static String MODEL_ProcessInterface_ParameterMissing; - + public static String MODEL_ProcessInterface_ParameterPending; - + public static String MODEL_ProcessInterface_NoMapping; - + public static String MODEL_ProcessInterface_IncompatibleTypes; - + public static String MSG_ClassCanNotBeResolved; public static String MSG_ClassNotSerilizable; - + public static String MSG_ConstructorNotVisible; public static String MSG_DataHasNoType; @@ -174,7 +174,7 @@ public class Validation_Messages extends NLS public static String MSG_InvalidDataMapping; public static String MSG_InvalidDataPath; - + public static String MSG_MissingDataPath; public static String MSG_InvalidDataSpecified; @@ -214,9 +214,9 @@ public class Validation_Messages extends NLS public static String MSG_JMSTRIGGER_NoValidTypeForParameter; public static String MSG_Trigger_UnspecifiedParticipant; - + public static String MSG_Scantrigger_UnspecifiedParticipant; - + public static String MSG_Scantrigger_NoDocumentDataSpecified; public static String MSG_Trigger_InvalidParticipant; @@ -274,11 +274,11 @@ public class Validation_Messages extends NLS public static String ERR_ROLE_WorksForManagerOf; public static String ERR_ROLE_WorksFor; - - public static String ERR_ROLE_ManagerOf; - public static String ERR_Trigger_InvalidScopedParticipant; - + public static String ERR_ROLE_ManagerOf; + + public static String ERR_Trigger_InvalidScopedParticipant; + public static String MSG_COND_PERFORMER_DuplicateId; public static String MSG_COND_PERFORMER_NoDataSet; @@ -299,7 +299,7 @@ public class Validation_Messages extends NLS public static String ERR_ACTIVITY_NoPerformerSet; - public static String ERR_ACTIVITY_QualityAssurancePerformer; + public static String ERR_ACTIVITY_QualityAssurancePerformer; public static String ERR_ACTIVITY_PerformerWronglySet; @@ -333,14 +333,14 @@ public class Validation_Messages extends NLS public static String ERR_ORGANIZATION_DuplicateId; - public static String ERR_ORGANIZATION_PartOf; + public static String ERR_ORGANIZATION_PartOf; + + public static String ERR_ORGANIZATION_InvalidScopeData; - public static String ERR_ORGANIZATION_InvalidScopeData; - public static String ERR_ELEMENT_EmptyId; public static String ERR_ELEMENT_InvalidId; - + public static String ERR_ELEMENT_IdLength; public static String MSG_ELEMENT_EmptyName; @@ -398,15 +398,15 @@ public static String Validation_MSG_JNDIPathNotSpecified; public static String EventHandlerValidator_MSG_NO_PERIOD_VALUE; public static String MSG_EmptyTransitionCond; - - public static String MSG_TransitionCondUpdate; - - public static String MSG_InvalidJavaScriptTransitionCondition; - + + public static String MSG_TransitionCondUpdate; + + public static String MSG_InvalidJavaScriptTransitionCondition; + public static String MSG_InvalidJavaScriptMessageTransformation; - - public static String MSG_MissingExternalClass; - + + public static String MSG_MissingExternalClass; + public static String MSG_InvalidExternalReference; public static String MSG_SyntaxInvalidTransitionCond; @@ -428,9 +428,9 @@ public static String Validation_MSG_JNDIPathNotSpecified; public static String MSG_NoBeanId; public static String Msg_XORSplitANDJoinBlock; - + public static String MSG_StartEventSymbolWrongConnected; - + public static String ERR_Invalid_TeamLeadConnection; public static String EXC_NOT_IMPLEMENTED; @@ -438,7 +438,7 @@ public static String Validation_MSG_JNDIPathNotSpecified; public static String WR_IS_A_RESERVED_IDENTIFIER; public static String WR_MAPPING_INCONSISTENT_DATA_MAPPING_ID; - + public static String MSG_REMOVED_TRANSFORMATION; public static String WR_MAPPING_NO_IN_DATA_MAPPING_SPECIFIED; @@ -446,15 +446,17 @@ public static String Validation_MSG_JNDIPathNotSpecified; public static String WR_MAPPING_NO_IN_DATA_MAPPING_WITH_ID_STELLE_NULL_FOUND; public static String WR_MD_HAS_AN_OLDER_VERSION; - + public static String MSG_KEY_DESCRIPTOR_PRIMITIVE_STRUCTURED; - + public static String MSG_KEY_DESCRIPTOR_PRIMITIVE; - + public static String MSG_KEY_DESCRIPTOR_INDEXED_PERSISTENT; - + public static String MSG_KEY_DESCRIPTOR_NO_SCHEMA; - + public static String MSG_KEY_DESCRIPTOR_NO_DESCRIPTOR; - + + public static String MSG_PERSISTENCE_OPTION_NOT_ALLOWED; + }
\ No newline at end of file diff --git a/modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/impl/DefaultProcessDefinitionValidator.java b/modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/impl/DefaultProcessDefinitionValidator.java index 0875035..fb4dc22 100644 --- a/modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/impl/DefaultProcessDefinitionValidator.java +++ b/modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/impl/DefaultProcessDefinitionValidator.java @@ -11,12 +11,25 @@ package org.eclipse.stardust.modeling.validation.impl; import java.text.MessageFormat; -import java.util.*; +import java.util.Arrays; +import java.util.List; +import java.util.Set; import org.eclipse.stardust.common.CollectionUtils; -import org.eclipse.stardust.model.xpdl.carnot.*; +import org.eclipse.stardust.model.xpdl.carnot.ActivityType; +import org.eclipse.stardust.model.xpdl.carnot.AttributeType; +import org.eclipse.stardust.model.xpdl.carnot.IExtensibleElement; +import org.eclipse.stardust.model.xpdl.carnot.IModelElement; +import org.eclipse.stardust.model.xpdl.carnot.ModelType; +import org.eclipse.stardust.model.xpdl.carnot.ProcessDefinitionType; +import org.eclipse.stardust.model.xpdl.carnot.TransitionType; +import org.eclipse.stardust.model.xpdl.carnot.util.AttributeUtil; import org.eclipse.stardust.model.xpdl.carnot.util.ModelUtils; -import org.eclipse.stardust.modeling.validation.*; +import org.eclipse.stardust.modeling.validation.IModelElementValidator; +import org.eclipse.stardust.modeling.validation.Issue; +import org.eclipse.stardust.modeling.validation.ValidationException; +import org.eclipse.stardust.modeling.validation.ValidationService; +import org.eclipse.stardust.modeling.validation.Validation_Messages; public class DefaultProcessDefinitionValidator implements IModelElementValidator { @@ -74,16 +87,16 @@ public class DefaultProcessDefinitionValidator implements IModelElementValidator { result.add(Issue.error(proc, Validation_Messages.MSG_NoActivity)); } - + if (null != startActivity) { Set<ActivityType> allActivities = CollectionUtils.newSet(); allActivities.addAll(proc.getActivity()); - + List<ActivityType> reachedActivities = CollectionUtils.newLinkedList(); Set<ActivityType> visitedActivities = CollectionUtils.newSet(); reachedActivities.add(startActivity); - + // span activity graph reachable from starting activity while (!reachedActivities.isEmpty()) { @@ -111,6 +124,24 @@ public class DefaultProcessDefinitionValidator implements IModelElementValidator } } + // validate auditTrailPersistence setting + AttributeType auditTrailPersistenceAttribute = AttributeUtil.getAttribute( + (IExtensibleElement) element, "carnot:engine:auditTrailPersistence"); + + if (auditTrailPersistenceAttribute != null) + { + String auditTrailPersistence = auditTrailPersistenceAttribute.getValue(); + List<String> options = ModelUtils.getPersistenceOptions((ProcessDefinitionType) element); + if ( !options.contains(auditTrailPersistence)) + { + result.add(Issue.warning( + proc, + MessageFormat.format( + Validation_Messages.MSG_PERSISTENCE_OPTION_NOT_ALLOWED, + new Object[] {ModelUtils.getPersistenceOptionsText(auditTrailPersistence)}))); + } + } + ValidationService vs = ValidationService.getInstance(); result.addAll(Arrays.asList(vs.validateModelElements(proc.getTrigger()))); @@ -148,4 +179,5 @@ public class DefaultProcessDefinitionValidator implements IModelElementValidator } return false; } + } diff --git a/modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/validation-messages.properties b/modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/validation-messages.properties index ba17e60..ae885b3 100644 --- a/modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/validation-messages.properties +++ b/modeling/org.eclipse.stardust.modeling.validation/src/org/eclipse/stardust/modeling/validation/validation-messages.properties @@ -35,7 +35,7 @@ MSG_DATAMAPPING_NoUniqueId=Data mapping has no unique id for the direction "{0}" MSG_DIAGRAM_NoJoinTypeNONE=Target activity for {1} must have Join type ''NONE'' MSG_JFC_UnspecifiedClass=Unspecified class for JFC application. MSG_JFC_CouldntFindClass=Couldn''t find class ''{0}'' for JFC application. -MSG_AmbiguousDeclaration=ambiguous declaration: +MSG_AmbiguousDeclaration=ambiguous declaration: MSG_CouldntFindMethodInClass=Couldn''t find method ''{0}'' in class ''{1}''. MSG_COND_PERFORMER_NoDataSet=No data set for conditional performer. MSG_JMSTRIGGER_ParameterNoId=Parameter has no id. @@ -61,7 +61,7 @@ MSG_NoStartActivity=No start activity is defined. MSG_DuplicateIdUsed=Duplicate Id used: ''{0}''. MSG_DuplicateDataId=Duplicate id for data. MSG_InvalidDataPath=Invalid data path -MSG_UnableToResolve=unable to resolve: +MSG_UnableToResolve=unable to resolve: MSG_InvalidSymbol=Invalid symbol ''{0}''. MSG_InvalidProcess=Invalid process specified. MSG_DataHasNoType=Data has no type. @@ -72,7 +72,7 @@ MSG_NoWorksForSymbols=WorksFor connection has no symbols. MSG_NoRefersToSymbols=RefersTo connection has no symbols. MSG_TemplateIsInvalid=Template for part ''{0}'' is invalid. MSG_TRIGGER_NoTypeSet=No type set for trigger. -MSG_WSDL_URLIsInvalid=WSDL URL ''{0}'' is invalid. +MSG_WSDL_URLIsInvalid=WSDL URL ''{0}'' is invalid. MSG_ELEMENT_EmptyName=The element name should not be empty. MSG_MethodNotSpecified={0} method not specified. MSG_MethodNotVisible=The method {0} from type {1} is not visible. @@ -145,7 +145,7 @@ ERR_ACTIVITY_PerformerWronglySet=Performer is set for non interactive activity. ERR_ACTIVITY_QualityAssurancePerformer=Conditional Performer not allowed for Quality Assurance. ERR_ACTIVITY_InvalidLoopCondition=Invalid loop condition. ERR_EVENTHANDLER_NoConditionType=Event handler does not have a condition type. -ERR_InvalidJavaBeanAccessPathType=Invalid Java Bean access path type: +ERR_InvalidJavaBeanAccessPathType=Invalid Java Bean access path type: ERR_DATAPATH_NoNameSpecified=No name specified for data path. ERR_DATAPATH_NoDataSpecified=No data specified for data path. ERR_EVENTHANDLER_DuplicateId=Duplicate id for event handler. @@ -176,7 +176,7 @@ MODEL_InvalidValidTo=Invalid 'Valid To' date specified. MODEL_ValidFromAfterValidTo=The model's 'Valid From' date must not be later than the 'Valid To' date. MODEL_ConfigurationVariable_NeverUsed=Configuration Variable ''{0}'' is never used. MODEL_ConfigurationVariable_NoDefaultValue=Configuration Variable ''{0}'' has no default value defined. -MODEL_ConfigurationVariable_NotAllowed = Usage of Configuration Variables not supported for ''{0}'' in ''{1}''. +MODEL_ConfigurationVariable_NotAllowed = Usage of Configuration Variables not supported for ''{0}'' in ''{1}''. MODEL_ConfigurationVariable_Invalid = ''{0}'' is not a valid model variable. MODEL_ConfigurationVariable_NAME = Configuration Variables should not be used in 'NAME' of a model element. MODEL_ConfigurationVariable_ID = Configuration Variables not supported within 'ID' of a model element. @@ -193,7 +193,7 @@ MODEL_ProcessInterface_ParameterPending = Implementing process provides paramete MODEL_ProcessInterface_NoMapping = Implementing process provides no mapping for parameter ''{0}''. MODEL_ProcessInterface_IncompatibleTypes = The type of the assigned Data of parameter ''{0}'' is incompatible to the type declared in the process interface. MODEL_ProcessInterface_Multiple_Implementations = Model ''{0}'' is providing multiple implementations for process interface ''{1}'' provided by model ''{2}''. -MODEL_ProcessInterface_InvalidForExternalInvocation = Process Interface invalid. External process invocation only allowed for parameters of type structured and following primitives: 'string, boolean, byte, char, double, int, long'. +MODEL_ProcessInterface_InvalidForExternalInvocation = Process Interface invalid. External process invocation only allowed for parameters of type structured and following primitives: 'string, boolean, byte, char, double, int, long'. TimerTrigger_InvalidPeriodicity=Invalid periodicity value. TXT_ID=id TXT_NAME=name @@ -222,4 +222,5 @@ MSG_KEY_DESCRIPTOR_INDEXED_PERSISTENT=Structured key descriptors must be indexed MSG_KEY_DESCRIPTOR_NO_SCHEMA=No schema found for structured key descriptor. MSG_KEY_DESCRIPTOR_NO_DESCRIPTOR=DataPath marked as key descriptor but it's not a descriptor. MSG_Scantrigger_UnspecifiedParticipant=Unspecified participant for scan trigger -MSG_Scantrigger_NoDocumentDataSpecified=No document data specified for scan trigger.
\ No newline at end of file +MSG_Scantrigger_NoDocumentDataSpecified=No document data specified for scan trigger. +MSG_PERSISTENCE_OPTION_NOT_ALLOWED=Persistence option ''{0}'' not allowed in this context.
\ No newline at end of file |

