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

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