Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
officejs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
officejs
Commits
4e099262
Commit
4e099262
authored
Jun 13, 2012
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Redesigning job rules in order to add some rules at any time.
parent
979fca4a
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
268 additions
and
246 deletions
+268
-246
OfficeJS/lib/jio/jio.js
OfficeJS/lib/jio/jio.js
+134
-123
OfficeJS/lib/jio/jio.min.js
OfficeJS/lib/jio/jio.min.js
+1
-1
OfficeJS/src/jio/jio.outro.js
OfficeJS/src/jio/jio.outro.js
+9
-0
OfficeJS/src/jio/jobs/jobRules.js
OfficeJS/src/jio/jobs/jobRules.js
+124
-122
No files found.
OfficeJS/lib/jio/jio.js
View file @
4e099262
...
@@ -1115,20 +1115,89 @@ var jobRules = (function(spec, my) {
...
@@ -1115,20 +1115,89 @@ var jobRules = (function(spec, my) {
var
that
=
{};
var
that
=
{};
// Attributes //
// Attributes //
var
priv
=
{};
var
priv
=
{};
priv
.
compare
=
{};
priv
.
action
=
{};
that
.
eliminate
=
function
()
{
return
'
eliminate
'
;
};
that
.
eliminate
=
function
()
{
return
'
eliminate
'
;
};
that
.
update
=
function
()
{
return
'
update
'
;
};
that
.
update
=
function
()
{
return
'
update
'
;
};
that
.
dontAccept
=
function
()
{
return
'
dont accept
'
;
};
that
.
dontAccept
=
function
()
{
return
'
dont accept
'
;
};
that
.
wait
=
function
()
{
return
'
wait
'
;
};
that
.
wait
=
function
()
{
return
'
wait
'
;
};
that
.
none
=
function
()
{
return
'
none
'
;
};
that
.
none
=
function
()
{
return
'
none
'
;
};
that
.
default_action
=
that
.
none
;
priv
.
compare
=
{
that
.
default_compare
=
function
(
job1
,
job2
)
{
};
priv
.
default_compare
=
function
(
job1
,
job2
)
{
return
(
job1
.
getCommand
().
getPath
()
===
job2
.
getCommand
().
getPath
()
&&
return
(
job1
.
getCommand
().
getPath
()
===
job2
.
getCommand
().
getPath
()
&&
JSON
.
stringify
(
job1
.
getStorage
().
serialized
())
===
JSON
.
stringify
(
job1
.
getStorage
().
serialized
())
===
JSON
.
stringify
(
job2
.
getStorage
().
serialized
()));
JSON
.
stringify
(
job2
.
getStorage
().
serialized
()));
};
};
priv
.
action
=
{
// Methods //
priv
.
getAction
=
function
(
job1
,
job2
)
{
var
j1label
,
j2label
,
j1status
;
j1label
=
job1
.
getCommand
().
getLabel
();
j2label
=
job2
.
getCommand
().
getLabel
();
j1status
=
(
job1
.
getStatus
().
getLabel
()
===
'
on going
'
?
'
on going
'
:
'
not on going
'
);
if
(
priv
.
action
[
j1label
]
&&
priv
.
action
[
j1label
][
j1status
]
&&
priv
.
action
[
j1label
][
j1status
][
j2label
])
{
return
priv
.
action
[
j1label
][
j1status
][
j2label
](
job1
,
job2
);
}
else
{
return
that
.
default_action
(
job1
,
job2
);
}
};
priv
.
canCompare
=
function
(
job1
,
job2
)
{
var
job1label
=
job1
.
getCommand
().
getLabel
(),
job2label
=
job2
.
getCommand
().
getLabel
();
if
(
priv
.
compare
[
job1label
]
&&
priv
.
compare
[
job2label
])
{
return
priv
.
compare
[
job1label
][
job2label
](
job1
,
job2
);
}
else
{
return
that
.
default_compare
(
job1
,
job2
);
}
};
/**
* Returns an action string to show what to do if we want to add a job.
* @method validateJobAccordingToJob
* @param job1 {object} The current job.
* @param job2 {object} The new job.
* @return {string} The action string.
*/
that
.
validateJobAccordingToJob
=
function
(
job1
,
job2
)
{
if
(
priv
.
canCompare
(
job1
,
job2
))
{
return
{
action
:
priv
.
getAction
(
job1
,
job2
),
job
:
job1
};
}
return
{
action
:
that
.
default_action
(
job1
,
job2
),
job
:
job1
};
};
/**
* Adds a rule the action rules.
* @method addActionRule
* @param method1 {string} The action label from the current job.
* @param ongoing {boolean} Is this action is on going or not?
* @param method2 {string} The action label from the new job.
* @param rule {function} The rule that return an action string.
*/
that
.
addActionRule
=
function
(
method1
,
ongoing
,
method2
,
rule
)
{
var
ongoing_s
=
(
ongoing
?
'
on going
'
:
'
not on going
'
);
priv
.
action
[
method1
]
=
priv
.
action
[
method1
]
||
{};
priv
.
action
[
method1
][
ongoing_s
]
=
priv
.
action
[
method1
][
ongoing_s
]
||
{};
priv
.
action
[
method1
][
ongoing_s
][
method2
]
=
rule
;
};
/**
* Adds a rule the compare rules.
* @method addCompareRule
* @param method1 {string} The action label from the current job.
* @param method2 {string} The action label from the new job.
* @param rule {function} The rule that return a boolean
* - true if job1 and job2 can be compared, else false.
*/
that
.
addCompareRule
=
function
(
method1
,
method2
,
rule
)
{
priv
.
compare
[
method1
]
=
priv
.
compare
[
method1
]
||
{};
priv
.
compare
[
method1
][
method2
]
=
rule
;
};
/*
/*
LEGEND:
LEGEND:
- s: storage
- s: storage
...
@@ -1179,103 +1248,36 @@ var jobRules = (function(spec, my) {
...
@@ -1179,103 +1248,36 @@ var jobRules = (function(spec, my) {
For more information, see documentation
For more information, see documentation
*/
*/
'
saveDocument
'
:{
that
.
addActionRule
(
'
saveDocument
'
,
true
,
'
saveDocument
'
,
'
on going
'
:{
function
(
job1
,
job2
){
'
saveDocument
'
:
function
(
job1
,
job2
){
if
(
job1
.
getCommand
().
getContent
()
===
if
(
job1
.
getCommand
().
getContent
()
===
job2
.
getCommand
().
getContent
())
{
job2
.
getCommand
().
getContent
())
{
return
that
.
dontAccept
();
return
that
.
dontAccept
();
}
else
{
}
else
{
return
that
.
wait
();
return
that
.
wait
();
}
}
},
});
'
loadDocument
'
:
that
.
wait
,
that
.
addActionRule
(
'
saveDocument
'
,
true
,
'
loadDocument
'
,
that
.
wait
);
'
removeDocument
'
:
that
.
wait
,
that
.
addActionRule
(
'
saveDocument
'
,
true
,
'
removeDocument
'
,
that
.
wait
);
'
getDocumentList
'
:
that
.
none
that
.
addActionRule
(
'
saveDocument
'
,
false
,
'
saveDocument
'
,
that
.
update
);
},
that
.
addActionRule
(
'
saveDocument
'
,
false
,
'
loadDocument
'
,
that
.
wait
);
'
not on going
'
:{
that
.
addActionRule
(
'
saveDocument
'
,
false
,
'
removeDocument
'
,
that
.
eliminate
);
'
saveDocument
'
:
that
.
update
,
'
loadDocument
'
:
that
.
wait
,
that
.
addActionRule
(
'
loadDocument
'
,
true
,
'
saveDocument
'
,
that
.
wait
);
'
removeDocument
'
:
that
.
eliminate
,
that
.
addActionRule
(
'
loadDocument
'
,
true
,
'
loadDocument
'
,
that
.
dontAccept
);
'
getDocumentList
'
:
that
.
none
that
.
addActionRule
(
'
loadDocument
'
,
true
,
'
removeDocument
'
,
that
.
wait
);
}
that
.
addActionRule
(
'
loadDocument
'
,
false
,
'
saveDocument
'
,
that
.
wait
);
},
that
.
addActionRule
(
'
loadDocument
'
,
false
,
'
loadDocument
'
,
that
.
update
);
'
loadDocument
'
:{
that
.
addActionRule
(
'
loadDocument
'
,
false
,
'
removeDocument
'
,
that
.
wait
);
'
on going
'
:{
'
saveDocument
'
:
that
.
wait
,
that
.
addActionRule
(
'
removeDocument
'
,
true
,
'
loadDocument
'
,
that
.
dontAccept
);
'
loadDocument
'
:
that
.
dontAccept
,
that
.
addActionRule
(
'
removeDocument
'
,
true
,
'
removeDocument
'
,
that
.
dontAccept
);
'
removeDocument
'
:
that
.
wait
,
that
.
addActionRule
(
'
removeDocument
'
,
false
,
'
saveDocument
'
,
that
.
eliminate
);
'
getDocumentList
'
:
that
.
none
that
.
addActionRule
(
'
removeDocument
'
,
false
,
'
loadDocument
'
,
that
.
dontAccept
);
},
that
.
addActionRule
(
'
removeDocument
'
,
false
,
'
removeDocument
'
,
that
.
update
);
'
not on going
'
:{
'
saveDocument
'
:
that
.
wait
,
that
.
addActionRule
(
'
getDocumentList
'
,
true
,
'
getDocumentList
'
,
that
.
dontAccept
);
'
loadDocument
'
:
that
.
update
,
that
.
addActionRule
(
'
getDocumentList
'
,
false
,
'
getDocumentList
'
,
that
.
update
);
'
removeDocument
'
:
that
.
wait
,
'
getDocumentList
'
:
that
.
none
}
},
'
removeDocument
'
:{
'
on going
'
:{
'
saveDocument
'
:
that
.
wait
,
'
loadDocument
'
:
that
.
dontAccept
,
'
removeDocument
'
:
that
.
dontAccept
,
'
getDocumentList
'
:
that
.
none
},
'
not on going
'
:{
'
saveDocument
'
:
that
.
eliminate
,
'
loadDocument
'
:
that
.
dontAccept
,
'
removeDocument
'
:
that
.
update
,
'
getDocumentList
'
:
that
.
none
}
},
'
getDocumentList
'
:{
'
on going
'
:{
'
saveDocument
'
:
that
.
none
,
'
loadDocument
'
:
that
.
none
,
'
removeDocument
'
:
that
.
none
,
'
getDocumentList
'
:
that
.
dontAccept
},
'
not on going
'
:{
'
saveDocument
'
:
that
.
none
,
'
loadDocument
'
:
that
.
none
,
'
removeDocument
'
:
that
.
none
,
'
getDocumentList
'
:
that
.
update
}
}
};
priv
.
default_action
=
that
.
none
;
// Methods //
priv
.
getAction
=
function
(
job1
,
job2
)
{
var
j1label
,
j2label
,
j1status
;
j1label
=
job1
.
getCommand
().
getLabel
();
j2label
=
job2
.
getCommand
().
getLabel
();
j1status
=
(
job1
.
getStatus
().
getLabel
()
===
'
on going
'
?
'
on going
'
:
'
not on going
'
);
if
(
priv
.
action
[
j1label
]
&&
priv
.
action
[
j1label
][
j1status
]
&&
priv
.
action
[
j1label
][
j1status
][
j2label
])
{
return
priv
.
action
[
j1label
][
j1status
][
j2label
](
job1
,
job2
);
}
else
{
return
priv
.
default_action
(
job1
,
job2
);
}
};
priv
.
canCompare
=
function
(
job1
,
job2
)
{
var
job1label
=
job1
.
getCommand
().
getLabel
(),
job2label
=
job2
.
getCommand
().
getLabel
();
if
(
priv
.
compare
[
job1label
]
&&
priv
.
compare
[
job2label
])
{
return
priv
.
compare
[
job1label
][
job2label
](
job1
,
job2
);
}
else
{
return
priv
.
default_compare
(
job1
,
job2
);
}
};
that
.
validateJobAccordingToJob
=
function
(
job1
,
job2
)
{
if
(
priv
.
canCompare
(
job1
,
job2
))
{
return
{
action
:
priv
.
getAction
(
job1
,
job2
),
job
:
job1
};
}
return
{
action
:
priv
.
default_action
(
job1
,
job2
),
job
:
job1
};
};
return
that
;
return
that
;
}());
}());
...
@@ -1333,6 +1335,15 @@ var jobRules = (function(spec, my) {
...
@@ -1333,6 +1335,15 @@ var jobRules = (function(spec, my) {
return
priv
.
id
;
return
priv
.
id
;
};
};
/**
* Returns the jio job rules object used by the job manager.
* @method getJobRules
* @return {object} The job rules object
*/
that
.
getJobRules
=
function
()
{
return
jobRules
;
};
/**
/**
* Checks if the storage description is valid or not.
* Checks if the storage description is valid or not.
* @method validateStorageDescription
* @method validateStorageDescription
...
...
OfficeJS/lib/jio/jio.min.js
View file @
4e099262
This diff is collapsed.
Click to expand it.
OfficeJS/src/jio/jio.outro.js
View file @
4e099262
...
@@ -52,6 +52,15 @@
...
@@ -52,6 +52,15 @@
return
priv
.
id
;
return
priv
.
id
;
};
};
/**
* Returns the jio job rules object used by the job manager.
* @method getJobRules
* @return {object} The job rules object
*/
that
.
getJobRules
=
function
()
{
return
jobRules
;
};
/**
/**
* Checks if the storage description is valid or not.
* Checks if the storage description is valid or not.
* @method validateStorageDescription
* @method validateStorageDescription
...
...
OfficeJS/src/jio/jobs/jobRules.js
View file @
4e099262
...
@@ -2,20 +2,89 @@ var jobRules = (function(spec, my) {
...
@@ -2,20 +2,89 @@ var jobRules = (function(spec, my) {
var
that
=
{};
var
that
=
{};
// Attributes //
// Attributes //
var
priv
=
{};
var
priv
=
{};
priv
.
compare
=
{};
priv
.
action
=
{};
that
.
eliminate
=
function
()
{
return
'
eliminate
'
;
};
that
.
eliminate
=
function
()
{
return
'
eliminate
'
;
};
that
.
update
=
function
()
{
return
'
update
'
;
};
that
.
update
=
function
()
{
return
'
update
'
;
};
that
.
dontAccept
=
function
()
{
return
'
dont accept
'
;
};
that
.
dontAccept
=
function
()
{
return
'
dont accept
'
;
};
that
.
wait
=
function
()
{
return
'
wait
'
;
};
that
.
wait
=
function
()
{
return
'
wait
'
;
};
that
.
none
=
function
()
{
return
'
none
'
;
};
that
.
none
=
function
()
{
return
'
none
'
;
};
that
.
default_action
=
that
.
none
;
priv
.
compare
=
{
that
.
default_compare
=
function
(
job1
,
job2
)
{
};
priv
.
default_compare
=
function
(
job1
,
job2
)
{
return
(
job1
.
getCommand
().
getPath
()
===
job2
.
getCommand
().
getPath
()
&&
return
(
job1
.
getCommand
().
getPath
()
===
job2
.
getCommand
().
getPath
()
&&
JSON
.
stringify
(
job1
.
getStorage
().
serialized
())
===
JSON
.
stringify
(
job1
.
getStorage
().
serialized
())
===
JSON
.
stringify
(
job2
.
getStorage
().
serialized
()));
JSON
.
stringify
(
job2
.
getStorage
().
serialized
()));
};
};
priv
.
action
=
{
// Methods //
priv
.
getAction
=
function
(
job1
,
job2
)
{
var
j1label
,
j2label
,
j1status
;
j1label
=
job1
.
getCommand
().
getLabel
();
j2label
=
job2
.
getCommand
().
getLabel
();
j1status
=
(
job1
.
getStatus
().
getLabel
()
===
'
on going
'
?
'
on going
'
:
'
not on going
'
);
if
(
priv
.
action
[
j1label
]
&&
priv
.
action
[
j1label
][
j1status
]
&&
priv
.
action
[
j1label
][
j1status
][
j2label
])
{
return
priv
.
action
[
j1label
][
j1status
][
j2label
](
job1
,
job2
);
}
else
{
return
that
.
default_action
(
job1
,
job2
);
}
};
priv
.
canCompare
=
function
(
job1
,
job2
)
{
var
job1label
=
job1
.
getCommand
().
getLabel
(),
job2label
=
job2
.
getCommand
().
getLabel
();
if
(
priv
.
compare
[
job1label
]
&&
priv
.
compare
[
job2label
])
{
return
priv
.
compare
[
job1label
][
job2label
](
job1
,
job2
);
}
else
{
return
that
.
default_compare
(
job1
,
job2
);
}
};
/**
* Returns an action string to show what to do if we want to add a job.
* @method validateJobAccordingToJob
* @param job1 {object} The current job.
* @param job2 {object} The new job.
* @return {string} The action string.
*/
that
.
validateJobAccordingToJob
=
function
(
job1
,
job2
)
{
if
(
priv
.
canCompare
(
job1
,
job2
))
{
return
{
action
:
priv
.
getAction
(
job1
,
job2
),
job
:
job1
};
}
return
{
action
:
that
.
default_action
(
job1
,
job2
),
job
:
job1
};
};
/**
* Adds a rule the action rules.
* @method addActionRule
* @param method1 {string} The action label from the current job.
* @param ongoing {boolean} Is this action is on going or not?
* @param method2 {string} The action label from the new job.
* @param rule {function} The rule that return an action string.
*/
that
.
addActionRule
=
function
(
method1
,
ongoing
,
method2
,
rule
)
{
var
ongoing_s
=
(
ongoing
?
'
on going
'
:
'
not on going
'
);
priv
.
action
[
method1
]
=
priv
.
action
[
method1
]
||
{};
priv
.
action
[
method1
][
ongoing_s
]
=
priv
.
action
[
method1
][
ongoing_s
]
||
{};
priv
.
action
[
method1
][
ongoing_s
][
method2
]
=
rule
;
};
/**
* Adds a rule the compare rules.
* @method addCompareRule
* @param method1 {string} The action label from the current job.
* @param method2 {string} The action label from the new job.
* @param rule {function} The rule that return a boolean
* - true if job1 and job2 can be compared, else false.
*/
that
.
addCompareRule
=
function
(
method1
,
method2
,
rule
)
{
priv
.
compare
[
method1
]
=
priv
.
compare
[
method1
]
||
{};
priv
.
compare
[
method1
][
method2
]
=
rule
;
};
/*
/*
LEGEND:
LEGEND:
- s: storage
- s: storage
...
@@ -66,102 +135,35 @@ var jobRules = (function(spec, my) {
...
@@ -66,102 +135,35 @@ var jobRules = (function(spec, my) {
For more information, see documentation
For more information, see documentation
*/
*/
'
saveDocument
'
:{
that
.
addActionRule
(
'
saveDocument
'
,
true
,
'
saveDocument
'
,
'
on going
'
:{
function
(
job1
,
job2
){
'
saveDocument
'
:
function
(
job1
,
job2
){
if
(
job1
.
getCommand
().
getContent
()
===
if
(
job1
.
getCommand
().
getContent
()
===
job2
.
getCommand
().
getContent
())
{
job2
.
getCommand
().
getContent
())
{
return
that
.
dontAccept
();
return
that
.
dontAccept
();
}
else
{
}
else
{
return
that
.
wait
();
return
that
.
wait
();
}
}
},
});
'
loadDocument
'
:
that
.
wait
,
that
.
addActionRule
(
'
saveDocument
'
,
true
,
'
loadDocument
'
,
that
.
wait
);
'
removeDocument
'
:
that
.
wait
,
that
.
addActionRule
(
'
saveDocument
'
,
true
,
'
removeDocument
'
,
that
.
wait
);
'
getDocumentList
'
:
that
.
none
that
.
addActionRule
(
'
saveDocument
'
,
false
,
'
saveDocument
'
,
that
.
update
);
},
that
.
addActionRule
(
'
saveDocument
'
,
false
,
'
loadDocument
'
,
that
.
wait
);
'
not on going
'
:{
that
.
addActionRule
(
'
saveDocument
'
,
false
,
'
removeDocument
'
,
that
.
eliminate
);
'
saveDocument
'
:
that
.
update
,
'
loadDocument
'
:
that
.
wait
,
that
.
addActionRule
(
'
loadDocument
'
,
true
,
'
saveDocument
'
,
that
.
wait
);
'
removeDocument
'
:
that
.
eliminate
,
that
.
addActionRule
(
'
loadDocument
'
,
true
,
'
loadDocument
'
,
that
.
dontAccept
);
'
getDocumentList
'
:
that
.
none
that
.
addActionRule
(
'
loadDocument
'
,
true
,
'
removeDocument
'
,
that
.
wait
);
}
that
.
addActionRule
(
'
loadDocument
'
,
false
,
'
saveDocument
'
,
that
.
wait
);
},
that
.
addActionRule
(
'
loadDocument
'
,
false
,
'
loadDocument
'
,
that
.
update
);
'
loadDocument
'
:{
that
.
addActionRule
(
'
loadDocument
'
,
false
,
'
removeDocument
'
,
that
.
wait
);
'
on going
'
:{
'
saveDocument
'
:
that
.
wait
,
that
.
addActionRule
(
'
removeDocument
'
,
true
,
'
loadDocument
'
,
that
.
dontAccept
);
'
loadDocument
'
:
that
.
dontAccept
,
that
.
addActionRule
(
'
removeDocument
'
,
true
,
'
removeDocument
'
,
that
.
dontAccept
);
'
removeDocument
'
:
that
.
wait
,
that
.
addActionRule
(
'
removeDocument
'
,
false
,
'
saveDocument
'
,
that
.
eliminate
);
'
getDocumentList
'
:
that
.
none
that
.
addActionRule
(
'
removeDocument
'
,
false
,
'
loadDocument
'
,
that
.
dontAccept
);
},
that
.
addActionRule
(
'
removeDocument
'
,
false
,
'
removeDocument
'
,
that
.
update
);
'
not on going
'
:{
'
saveDocument
'
:
that
.
wait
,
'
loadDocument
'
:
that
.
update
,
'
removeDocument
'
:
that
.
wait
,
'
getDocumentList
'
:
that
.
none
}
},
'
removeDocument
'
:{
'
on going
'
:{
'
saveDocument
'
:
that
.
wait
,
'
loadDocument
'
:
that
.
dontAccept
,
'
removeDocument
'
:
that
.
dontAccept
,
'
getDocumentList
'
:
that
.
none
},
'
not on going
'
:{
'
saveDocument
'
:
that
.
eliminate
,
'
loadDocument
'
:
that
.
dontAccept
,
'
removeDocument
'
:
that
.
update
,
'
getDocumentList
'
:
that
.
none
}
},
'
getDocumentList
'
:{
'
on going
'
:{
'
saveDocument
'
:
that
.
none
,
'
loadDocument
'
:
that
.
none
,
'
removeDocument
'
:
that
.
none
,
'
getDocumentList
'
:
that
.
dontAccept
},
'
not on going
'
:{
'
saveDocument
'
:
that
.
none
,
'
loadDocument
'
:
that
.
none
,
'
removeDocument
'
:
that
.
none
,
'
getDocumentList
'
:
that
.
update
}
}
};
priv
.
default_action
=
that
.
none
;
// Methods //
priv
.
getAction
=
function
(
job1
,
job2
)
{
var
j1label
,
j2label
,
j1status
;
j1label
=
job1
.
getCommand
().
getLabel
();
j2label
=
job2
.
getCommand
().
getLabel
();
j1status
=
(
job1
.
getStatus
().
getLabel
()
===
'
on going
'
?
'
on going
'
:
'
not on going
'
);
if
(
priv
.
action
[
j1label
]
&&
priv
.
action
[
j1label
][
j1status
]
&&
priv
.
action
[
j1label
][
j1status
][
j2label
])
{
return
priv
.
action
[
j1label
][
j1status
][
j2label
](
job1
,
job2
);
}
else
{
return
priv
.
default_action
(
job1
,
job2
);
}
};
priv
.
canCompare
=
function
(
job1
,
job2
)
{
var
job1label
=
job1
.
getCommand
().
getLabel
(),
job2label
=
job2
.
getCommand
().
getLabel
();
if
(
priv
.
compare
[
job1label
]
&&
priv
.
compare
[
job2label
])
{
return
priv
.
compare
[
job1label
][
job2label
](
job1
,
job2
);
}
else
{
return
priv
.
default_compare
(
job1
,
job2
);
}
};
that
.
validateJobAccordingToJob
=
function
(
job1
,
job2
)
{
if
(
priv
.
canCompare
(
job1
,
job2
))
{
return
{
action
:
priv
.
getAction
(
job1
,
job2
),
job
:
job1
};
}
return
{
action
:
priv
.
default_action
(
job1
,
job2
),
job
:
job1
};
};
that
.
addActionRule
(
'
getDocumentList
'
,
true
,
'
getDocumentList
'
,
that
.
dontAccept
);
that
.
addActionRule
(
'
getDocumentList
'
,
false
,
'
getDocumentList
'
,
that
.
update
);
return
that
;
return
that
;
}());
}());
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment