-
Notifications
You must be signed in to change notification settings - Fork 40
Swf decider graph
neyric edited this page Jan 13, 2013
·
4 revisions
Graphviz must be install on your computer.
On MacOs using MacPorts :
$ sudo port install graphviz
The path to 'dot' can be configured in cli/swf-decider-graph.js, if it is not in your PATH
$ swf-decider-graph examples/ec2-demo/ec2-demo.js
Here is the code it has been generated from :
// Create a server
schedule({
name: 'step1',
activity: 'ec2_runInstances',
input: {
ImageId: "ami-de46b4b7",
MinCount: 1,
MaxCount: 1,
UserData: "This is some cool user data\nOuyeah\n",
InstanceType: "m1.small",
KeyName: "quickflow",
Monitoring: {
Enabled: false
}
}
});
// Use a SWF Timer
start_timer({
name: 'step2',
delay: 60,
after: 'step1'
});
// Close the server
schedule({
name: 'step3',
activity: 'ec2_terminateInstances',
after: 'step2',
input: function() {
var instanceId = results('step1').instancesSet.item.instanceId;
return { InstanceIds: [instanceId] };
}
});
stop({
after: {
step3: COMPLETED
},
result: 'Everything is good !'
});