-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* rename goal state to termination condition
- Loading branch information
Showing
12 changed files
with
284 additions
and
283 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
app/lib/terminationconditionmodeler/TerminationConditionEvents.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default { | ||
TERMINATIONCONDITION_CHANGED : 'tc.changed', | ||
} |
74 changes: 37 additions & 37 deletions
74
app/lib/goalstatemodeler/GoalStateModdle.js → ...tionmodeler/TerminationConditionModdle.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
import { assign } from 'min-dash'; | ||
|
||
import { Moddle } from 'moddle'; | ||
|
||
import { Reader, Writer } from 'moddle-xml'; | ||
|
||
import Descriptor from './gs.json'; | ||
|
||
export default function GoalStateModdle() { | ||
Moddle.call(this, {gs : Descriptor}); | ||
} | ||
|
||
GoalStateModdle.prototype = Object.create(Moddle.prototype); | ||
|
||
GoalStateModdle.prototype.fromXML = function (xmlStr, options) { | ||
var typeName = 'gs:Disjunction'; | ||
var reader = new Reader(assign({ model: this, lax: false }, options)); | ||
var rootHandler = reader.handler(typeName); | ||
|
||
return reader.fromXML(xmlStr, rootHandler); | ||
}; | ||
|
||
|
||
GoalStateModdle.prototype.toXML = function (element, options) { | ||
var writer = new Writer(options); | ||
|
||
return new Promise(function (resolve, reject) { | ||
try { | ||
var result = writer.toXML(element); | ||
|
||
return resolve({ | ||
xml: result | ||
}); | ||
} catch (err) { | ||
return reject(err); | ||
} | ||
}); | ||
import { assign } from 'min-dash'; | ||
|
||
import { Moddle } from 'moddle'; | ||
|
||
import { Reader, Writer } from 'moddle-xml'; | ||
|
||
import Descriptor from './tc.json'; | ||
|
||
export default function TerminationConditionModdle() { | ||
Moddle.call(this, {tc : Descriptor}); | ||
} | ||
|
||
TerminationConditionModdle.prototype = Object.create(Moddle.prototype); | ||
|
||
TerminationConditionModdle.prototype.fromXML = function (xmlStr, options) { | ||
var typeName = 'tc:Disjunction'; | ||
var reader = new Reader(assign({ model: this, lax: false }, options)); | ||
var rootHandler = reader.handler(typeName); | ||
|
||
return reader.fromXML(xmlStr, rootHandler); | ||
}; | ||
|
||
|
||
TerminationConditionModdle.prototype.toXML = function (element, options) { | ||
var writer = new Writer(options); | ||
|
||
return new Promise(function (resolve, reject) { | ||
try { | ||
var result = writer.toXML(element); | ||
|
||
return resolve({ | ||
xml: result | ||
}); | ||
} catch (err) { | ||
return reject(err); | ||
} | ||
}); | ||
}; |
Oops, something went wrong.