Skip to content
This repository was archived by the owner on Mar 31, 2019. It is now read-only.

Commit ee63d58

Browse files
committed
Merge branch 'develop'
Conflicts: pom.xml src/main/java/org/cristalise/kernel/graph/model/GraphableVertex.java
2 parents a0f00e7 + bda01ea commit ee63d58

File tree

65 files changed

+1928
-560
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1928
-560
lines changed

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
language: java
22
jdk: oraclejdk8
33
branches:
4-
only:
5-
- master
4+
only:
5+
- master
6+
- release
7+
- develop
68
cache:
79
directories:
810
- "$HOME/.m2"

pom.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<groupId>org.cristalise</groupId>
2828
<artifactId>cristalise-kernel</artifactId>
2929
<name>cristalise-kernel</name>
30-
<version>3.4.2</version>
30+
<version>3.5.0</version>
3131
<description>Cristal-ise is a description-driven software platform originally developed to track the construction of
3232
the CMS ECAL detector of the LHC at CERN. This is its core library, known as the kernel, which manages
3333
business objects called Items. Items are entirely configured from data, called descriptions, held in other Items.
@@ -133,6 +133,12 @@
133133
<version>4.12</version>
134134
<scope>test</scope>
135135
</dependency>
136+
<dependency>
137+
<groupId>org.hamcrest</groupId>
138+
<artifactId>hamcrest-all</artifactId>
139+
<version>1.3</version>
140+
<scope>test</scope>
141+
</dependency>
136142
<dependency>
137143
<groupId>org.spockframework</groupId>
138144
<artifactId>spock-core</artifactId>
@@ -148,7 +154,7 @@
148154
<dependency>
149155
<groupId>org.codehaus.groovy</groupId>
150156
<artifactId>groovy-all</artifactId>
151-
<version>2.4.12</version>
157+
<version>2.4.15</version>
152158
<scope>test</scope>
153159
</dependency>
154160
<dependency>

src/main/idl/CommonExceptions.idl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ module common
5959
**************************************************************************/
6060
exception InvalidCollectionModification
6161
{
62+
string details;
6263
};
6364

6465

src/main/idl/Entity.idl

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ module entity
4141
* in a tree structure.
4242
**/
4343

44-
interface Item
44+
interface Item
4545
{
4646

4747
/**
@@ -57,12 +57,16 @@ module entity
5757
* Property objects of the Item
5858
* @param workflow The XML marshalled new lifecycle of the Item
5959
* @param collection The XML marshalled CollectionArrayList of the initial state of the Item's collections
60+
* @param viewpoint the XML marshalled Viewpoint to be stored to find the Outcome
61+
* @param outcome the XML data to be stored
6062
* @exception ObjectNotFoundException
6163
**/
6264
void initialise( in common::SystemKey agentKey,
63-
in string itemProps,
65+
in string itemProps,
6466
in string workflow,
65-
in string collections )
67+
in string collections,
68+
in string viewpoint,
69+
in string outcome )
6670
raises( common::AccessRightsException,
6771
common::InvalidDataException,
6872
common::PersistencyException,
@@ -94,6 +98,8 @@ module entity
9498
common::ObjectNotFoundException,
9599
common::PersistencyException );
96100

101+
typedef sequence<octet> OctetSequence;
102+
97103
/**
98104
* Requests a transition of an Activity in this Item's workflow. If possible and permitted, an Event is
99105
* generated and stored, the Activity's state is updated, which may cause the Workflow to proceed. If
@@ -114,6 +120,10 @@ module entity
114120
* @param requestData The XML Outcome of the work defined by the Activity. Must be valid to the XML Schema,
115121
* though this is not verified on the server, rather in the AgentProxy in the Client API.
116122
*
123+
* @param attachmentType the MimeType of the attachment (can be empty)
124+
*
125+
* @param attachment binary data associated with the Outcome (can be empty)
126+
*
117127
* @throws AccessRightsException The Agent is not permitted to perform the operation. Either it does not
118128
* have the correct role, or the Activity is reserved by another Agent. Also thrown when the given Agent ID doesn't exist.
119129
* @throws InvalidTransitionException The Activity is not in the correct state to make the requested transition.
@@ -126,7 +136,9 @@ module entity
126136
string requestAction( in common::SystemKey agentKey,
127137
in string stepPath,
128138
in unsigned long transitionID,
129-
in string requestData
139+
in string requestData,
140+
in string attachmentType,
141+
in OctetSequence attachment
130142
)
131143
raises( common::AccessRightsException,
132144
common::InvalidTransitionException,
@@ -137,10 +149,12 @@ module entity
137149
common::InvalidCollectionModification);
138150

139151
string delegatedAction( in common::SystemKey agentKey,
140-
in common::SystemKey delegateAgentKey,
141-
in string stepPath,
142-
in unsigned long transitionID,
143-
in string requestData
152+
in common::SystemKey delegateAgentKey,
153+
in string stepPath,
154+
in unsigned long transitionID,
155+
in string requestData,
156+
in string attachmentType,
157+
in OctetSequence attachment
144158
)
145159
raises( common::AccessRightsException,
146160
common::InvalidTransitionException,

src/main/java/org/cristalise/kernel/collection/BuiltInCollections.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ public enum BuiltInCollections {
4949
*/
5050
SCHEMA("Schema"),
5151

52+
SCHEMA_INITIALISE("SchemaInitialise"),
53+
54+
SCHEMA_MASTER("SchemaMaster"),
55+
5256
/**
5357
* CollectionDescription of elementary ActivityDef. It is instantiated as two Activity properties (see bellow).
5458
* Also it is Dependency Collection of Workflow.

src/main/java/org/cristalise/kernel/collection/Dependency.java

Lines changed: 68 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import org.cristalise.kernel.common.InvalidDataException;
4444
import org.cristalise.kernel.common.ObjectAlreadyExistsException;
4545
import org.cristalise.kernel.common.ObjectNotFoundException;
46+
import org.cristalise.kernel.graph.model.BuiltInVertexProperties;
4647
import org.cristalise.kernel.lifecycle.ActivityDef;
4748
import org.cristalise.kernel.lookup.ItemPath;
4849
import org.cristalise.kernel.process.Gateway;
@@ -173,6 +174,30 @@ public void updateMember(ItemPath childPath, int memberID, CastorHashMap memberN
173174
public DependencyMember addMember(ItemPath itemPath)
174175
throws InvalidCollectionModification, ObjectAlreadyExistsException
175176
{
177+
DependencyMember depMember = createMember(itemPath);
178+
mMembers.list.add(depMember);
179+
180+
Logger.msg(8, "Dependency.addMember(" + itemPath + ") added to children with slotId:"+depMember.getID());
181+
return depMember;
182+
}
183+
184+
/**
185+
*
186+
* @param depMember
187+
* @throws InvalidCollectionModification
188+
* @throws ObjectAlreadyExistsException
189+
*/
190+
public void addMember(DependencyMember depMember) throws InvalidCollectionModification, ObjectAlreadyExistsException {
191+
mMembers.list.add(depMember);
192+
}
193+
/**
194+
*
195+
* @param itemPath
196+
* @return
197+
* @throws InvalidCollectionModification
198+
* @throws ObjectAlreadyExistsException
199+
*/
200+
public DependencyMember createMember(ItemPath itemPath) throws InvalidCollectionModification, ObjectAlreadyExistsException {
176201
if (itemPath == null)
177202
throw new InvalidCollectionModification("Cannot add empty slot to Dependency collection");
178203

@@ -187,9 +212,6 @@ public DependencyMember addMember(ItemPath itemPath)
187212

188213
// assign entity
189214
depMember.assignItem(itemPath);
190-
mMembers.list.add(depMember);
191-
192-
Logger.msg(8, "Dependency.addMember(" + itemPath + ") added to children with slotId:"+depMember.getID());
193215
return depMember;
194216
}
195217

@@ -215,11 +237,29 @@ public List<DependencyMember> compare(Dependency other) {
215237
@Override
216238
public DependencyMember addMember(ItemPath itemPath, CastorHashMap props, String classProps)
217239
throws InvalidCollectionModification, ObjectAlreadyExistsException
240+
{
241+
DependencyMember depMember = createMember(itemPath, props);
242+
mMembers.list.add(depMember);
243+
Logger.msg(8, "Dependency.addMember(" + itemPath + ") added to children with slotId:"+depMember.getID());
244+
return depMember;
245+
}
246+
247+
/**
248+
*
249+
* @param itemPath
250+
* @param props
251+
* @return
252+
* @throws InvalidCollectionModification
253+
* @throws ObjectAlreadyExistsException
254+
*/
255+
public DependencyMember createMember(ItemPath itemPath, CastorHashMap props)
256+
throws InvalidCollectionModification, ObjectAlreadyExistsException
218257
{
219258
if (itemPath == null)
220259
throw new InvalidCollectionModification("Cannot add empty slot to Dependency collection");
221260

222261
boolean checkUniqueness = Gateway.getProperties().getBoolean("Dependency.checkMemberUniqueness", true);
262+
223263
if (checkUniqueness && contains(itemPath))
224264
throw new ObjectAlreadyExistsException("Item "+itemPath+" already exists in Dependency "+getName());
225265

@@ -239,8 +279,6 @@ public DependencyMember addMember(ItemPath itemPath, CastorHashMap props, String
239279

240280
// assign entity
241281
depMember.assignItem(itemPath);
242-
mMembers.list.add(depMember);
243-
Logger.msg(8, "Dependency.addMember(" + itemPath + ") added to children with slotId:"+depMember.getID());
244282
return depMember;
245283
}
246284

@@ -383,7 +421,7 @@ public void addToVertexProperties(CastorHashMap props) throws InvalidDataExcepti
383421
}
384422
catch (ObjectNotFoundException e) {
385423
//Schema dependency could be defined in Properties
386-
if(props.containsKey(SCHEMA_NAME)) {
424+
if(props.containsKey(SCHEMA_NAME.getName())) {
387425
Logger.msg(8, "Dependency.addToVertexProperties() - BACKWARD COMPABILITY: Dependency '"+getName()+"' is defined in Properties");
388426
String uuid = LocalObjectLoader.getSchema(props).getItemPath().getUUID().toString();
389427
props.setBuiltInProperty(SCHEMA_NAME, uuid);
@@ -399,7 +437,7 @@ public void addToVertexProperties(CastorHashMap props) throws InvalidDataExcepti
399437
}
400438
catch (ObjectNotFoundException e) {
401439
//Backward compability: Script dependency could be defined in Properties
402-
if(props.containsKey(SCRIPT_NAME)) {
440+
if(props.containsKey(SCRIPT_NAME.getName())) {
403441
Logger.msg(8, "Dependency.addToVertexProperties() - BACKWARD COMPABILITY: Dependency '"+getName()+"' is defined in Properties");
404442
String uuid = LocalObjectLoader.getScript(props).getItemPath().getUUID().toString();
405443
props.setBuiltInProperty(SCRIPT_NAME, uuid);
@@ -415,7 +453,7 @@ public void addToVertexProperties(CastorHashMap props) throws InvalidDataExcepti
415453
}
416454
catch (ObjectNotFoundException e) {
417455
//Backward compability: Query dependency could be defined in Properties
418-
if(props.containsKey(QUERY_NAME)) {
456+
if(props.containsKey(QUERY_NAME.getName())) {
419457
Logger.msg(8, "Dependency.addToVertexProperties() - BACKWARD COMPABILITY: Dependency '"+getName()+"' is defined in Properties");
420458
String uuid = LocalObjectLoader.getQuery(props).getItemPath().getUUID().toString();
421459
props.setBuiltInProperty(QUERY_NAME, uuid);
@@ -430,7 +468,7 @@ public void addToVertexProperties(CastorHashMap props) throws InvalidDataExcepti
430468
props.setBuiltInProperty(STATE_MACHINE_VERSION, memberVer);
431469
}
432470
catch (ObjectNotFoundException e) {
433-
if(props.containsKey(STATE_MACHINE_NAME)) {
471+
if(props.containsKey(STATE_MACHINE_NAME.getName())) {
434472
Logger.msg(8, "Dependency.addToVertexProperties() - BACKWARD COMPABILITY: Dependency '"+getName()+"' is defined in Properties");
435473
String uuid = LocalObjectLoader.getStateMachine(props).getItemPath().getUUID().toString();
436474
props.setBuiltInProperty(STATE_MACHINE_NAME, uuid);
@@ -442,7 +480,7 @@ public void addToVertexProperties(CastorHashMap props) throws InvalidDataExcepti
442480
ActivityDef actDef = LocalObjectLoader.getActDef(memberUUID, memberVer);
443481
CastorHashMap chm = null;
444482

445-
if(props.containsKey(ACTIVITY_DEF_URN)) {
483+
if(props.containsKey(ACTIVITY_DEF_URN.getName())) {
446484
chm = (CastorHashMap)props.getBuiltInProperty(ACTIVITY_DEF_URN);
447485
}
448486
else {
@@ -483,4 +521,24 @@ private boolean convertToVertextPropsByScript(CastorHashMap props, DependencyMem
483521
}
484522
return false;
485523
}
524+
525+
/**
526+
* Method of convenience to get property value using BuiltInVertexProperties
527+
*
528+
* @param prop the property to read
529+
* @return the value, can be null
530+
*/
531+
public Object getBuiltInProperty(BuiltInVertexProperties prop) {
532+
return mProperties.get(prop.getName());
533+
}
534+
535+
/**
536+
* Method of convenience to check if property exists
537+
*
538+
* @param prop the property to check
539+
* @return true if property exist, false otherwise
540+
*/
541+
public boolean containsBuiltInProperty(BuiltInVertexProperties prop) {
542+
return mProperties.containsKey(prop.getName());
543+
}
486544
}

0 commit comments

Comments
 (0)