Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genotoul-bioinfo
jflow
Commits
f924579c
Commit
f924579c
authored
Jun 14, 2013
by
Jerome Mariette
Browse files
add metadata to workflows
parent
224d72a4
Changes
3
Hide whitespace changes
Inline
Side-by-side
bin/jflow_server.py
View file @
f924579c
...
...
@@ -94,6 +94,7 @@ class JFlowServer (object):
"completed"
:
status_info
[
"completed"
]})
status
=
{
"id"
:
utils
.
get_nb_string
(
workflow
.
id
),
"name"
:
workflow
.
name
,
"metadata"
:
workflow
.
metadata
,
"status"
:
workflow
.
get_status
(),
"elapsed_time"
:
str
(
elapsed_time
),
"start_time"
:
start_time
,
...
...
@@ -146,7 +147,17 @@ class JFlowServer (object):
status
=
[]
workflows
=
self
.
wfmanager
.
get_workflows
()
for
workflow
in
workflows
:
status
.
append
(
self
.
jsonify_workflow_status
(
workflow
))
if
kwargs
.
has_key
(
"metadata_filter"
):
is_ok
=
False
for
wf_meta
in
workflow
.
metadata
:
for
metadata
in
kwargs
[
"metadata_filter"
].
split
(
","
):
if
wf_meta
==
metadata
:
is_ok
=
True
break
if
is_ok
:
break
if
is_ok
:
status
.
append
(
self
.
jsonify_workflow_status
(
workflow
))
else
:
status
.
append
(
self
.
jsonify_workflow_status
(
workflow
))
return
status
...
...
src/jflow/workflow.py
View file @
f924579c
...
...
@@ -90,6 +90,7 @@ class Workflow(threading.Thread):
self
.
id
=
id
self
.
args
=
self
.
_extend_and_format_args
(
args
)
self
.
metadata
=
self
.
args
[
"metadata"
]
if
self
.
id
is
not
None
:
self
.
directory
=
self
.
manager
.
get_workflow_directory
(
self
.
name
,
self
.
id
)
if
not
os
.
path
.
isdir
(
self
.
directory
):
...
...
@@ -239,7 +240,7 @@ class Workflow(threading.Thread):
parameters
=
[]
try
:
params
=
{}
#
F
irst grab all parameters name
#
f
irst grab all parameters name
for
param
in
reader
.
items
(
"parameters"
):
cvalue
=
reader
.
get
(
"parameters"
,
param
[
0
])
cparam
=
param
[
0
].
split
(
"."
)[
0
]
...
...
@@ -253,6 +254,9 @@ class Workflow(threading.Thread):
parameters
.
append
(
oparam
)
except
:
pass
# finally add the metadata parameter
metadata
=
Parameter
(
"metadata"
,
"--metadata"
,
"Which metadata should be linked to this workflow"
,
action
=
"append"
)
parameters
.
append
(
metadata
)
return
[
reader
.
get
(
"global"
,
"name"
),
reader
.
get
(
"global"
,
"description"
),
parameters
]
...
...
src/js/jflow-activewf.js
View file @
f924579c
...
...
@@ -45,10 +45,15 @@
'
<div class="blockG" id="rotateG_06"></div>
'
,
'
<div class="blockG" id="rotateG_07"></div>
'
,
'
<div class="blockG" id="rotateG_08"></div>
'
,
'
</div></div> <div class="span6">Please wait until modul is being loaded!</div></div>
'
].
join
(
'
\n
'
);
'
</div></div> <div class="span6">Please wait until modul is being loaded!</div></div>
'
].
join
(
'
\n
'
),
url
=
this
.
options
.
serverURL
+
'
/get_workflows_status?
'
;
if
(
this
.
options
.
metadataFilter
.
length
>
0
)
{
url
+=
'
metadata_filter=
'
+
this
.
options
.
metadataFilter
.
join
(
'
,
'
)
+
'
&
'
;
}
url
+=
'
callback=?
'
;
$this
.
$element
.
html
(
waiting_animation
);
$
.
ajax
({
url
:
this
.
options
.
serverURL
+
'
/get_workflows_status?callback=?
'
,
url
:
url
,
dataType
:
"
json
"
,
timeout
:
20000
,
error
:
function
(
xhr
,
ajaxOptions
,
thrownError
)
{
...
...
@@ -125,7 +130,8 @@
'
</tr>
'
,
'
{{/each}}
'
,
'
</table>
'
,
'
<p class="text-right"><button class="btn" id="activewf_refresh_btn" href="#"><i class="icon-refresh"></i> Refresh</button></p>
'
].
join
(
'
\n
'
)
'
<p class="text-right"><button class="btn" id="activewf_refresh_btn" href="#"><i class="icon-refresh"></i> Refresh</button></p>
'
].
join
(
'
\n
'
),
metadataFilter
:
[]
}
$
.
fn
.
activewf
.
Constructor
=
ActiveWF
...
...
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