Minor change to Mistral schema

Name members of Task->requires sequence as 'Task#' instead of
'Element#'.

Change-Id: I2e35369fb9341babb8d8507a17812518df3e7d35
This commit is contained in:
Timur Sufiev 2014-10-06 16:54:35 +04:00
parent 5e541bb05b
commit e2428306cd

View File

@ -159,30 +159,34 @@
'requires': {
'@type': Array,
'*': {
'@type': String,
'@enum': function() {
var container = this._container,
workflow, task;
while ( container ) {
if ( container.instanceof(types.Mistral.Task) ) {
task = container;
'@class': Barricade.Primitive.extend({
'name': 'Action'
}, {
'@type': String,
'@enum': function() {
var container = this._container,
workflow, task;
while ( container ) {
if ( container.instanceof(types.Mistral.Task) ) {
task = container;
}
if ( container.instanceof(types.Mistral.Workflow) ) {
workflow = container;
break;
}
container = container._container;
}
if ( container.instanceof(types.Mistral.Workflow) ) {
workflow = container;
break;
if ( workflow && task ) {
return workflow.get('tasks').toArray().filter(function(taskItem) {
return !(taskItem === task) && taskItem.get('name').get();
}).map(function(taskItem) {
return taskItem.get('name').get();
});
} else {
return [];
}
container = container._container;
}
if ( workflow && task ) {
return workflow.get('tasks').toArray().filter(function(taskItem) {
return !(taskItem === task) && taskItem.get('name').get();
}).map(function(taskItem) {
return taskItem.get('name').get();
});
} else {
return [];
}
}
})
}
}
};