@@ -47,8 +47,8 @@ class Controller {
47
47
'feeder:status' : [ ] ,
48
48
'sender:status' : [ ] ,
49
49
'workflow:state' : [ ] ,
50
- 'controller:state ' : [ ] ,
51
- 'controller:settings ' : [ ]
50
+ 'controller:settings ' : [ ] ,
51
+ 'controller:state ' : [ ]
52
52
} ;
53
53
54
54
context = {
@@ -67,9 +67,12 @@ class Controller {
67
67
loadedControllers = [ ] ;
68
68
port = '' ;
69
69
type = '' ;
70
- state = { } ;
71
70
settings = { } ;
72
- workflowState = 'idle' ; // running|paused|idle
71
+ state = { } ;
72
+ workflow = {
73
+ state : 'idle' , // running|paused|idle
74
+ context : { }
75
+ } ;
73
76
74
77
// @param {object } io The socket.io-client module.
75
78
constructor ( io ) {
@@ -112,19 +115,20 @@ class Controller {
112
115
this . type = '' ;
113
116
this . state = { } ;
114
117
this . settings = { } ;
115
- this . workflowState = 'idle' ;
118
+ this . workflow . state = 'idle' ;
116
119
}
117
120
if ( eventName === 'workflow:state' ) {
118
- this . workflowState = args [ 0 ] ;
119
- }
120
- if ( eventName === 'controller:state' ) {
121
- this . type = args [ 0 ] ;
122
- this . state = { ...args [ 1 ] } ;
121
+ this . workflow . state = args [ 0 ] ;
122
+ this . workflow . context = { ...args [ 1 ] } ;
123
123
}
124
124
if ( eventName === 'controller:settings' ) {
125
125
this . type = args [ 0 ] ;
126
126
this . settings = { ...args [ 1 ] } ;
127
127
}
128
+ if ( eventName === 'controller:state' ) {
129
+ this . type = args [ 0 ] ;
130
+ this . state = { ...args [ 1 ] } ;
131
+ }
128
132
129
133
const listeners = ensureArray ( this . listeners [ eventName ] ) ;
130
134
listeners . forEach ( listener => {
0 commit comments