-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxnat_workflow_utilities.sh
87 lines (77 loc) · 1.9 KB
/
xnat_workflow_utilities.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#
# Prerequisites:
# XNAT_UTILS_HOME must be set
#
# Show information about a specified XNAT Workflow
xnat_workflow_show()
{
local server=${1}
local username=${2}
local password=${3}
local workflow_id=${4}
${XNAT_UTILS_HOME}/xnat_workflow_info \
--server=${server} \
--username=${username} \
--password=${password} \
--workflow-id=${workflow_id} \
show
}
# Update information (step id, step description, and percent complete)
# for a specified XNAT Workflow
xnat_workflow_update()
{
local server=${1}
local username=${2}
local password=${3}
local workflow_id=${4}
local step_id=${5}
local step_desc=${6}
local percent_complete=${7}
echo ""
echo ""
echo "---------- Step: ${step_id} "
echo "---------- Desc: ${step_desc} "
echo ""
echo ""
echo "xnat_workflow_update - workflow_id: ${workflow_id}"
echo "xnat_workflow_update - step_id: ${step_id}"
echo "xnat_workflow_update - step_desc: ${step_desc}"
echo "xnat_workflow_update - percent_complete: ${percent_complete}"
${XNAT_UTILS_HOME}/xnat_workflow_info \
--server="${server}" \
--username="${username}" \
--password="${password}" \
--workflow-id="${workflow_id}" \
update \
--step-id="${step_id}" \
--step-description="${step_desc}" \
--percent-complete="${percent_complete}"
}
# Mark the specified XNAT Workflow as complete
xnat_workflow_complete()
{
local server=${1}
local username=${2}
local password=${3}
local workflow_id=${4}
${XNAT_UTILS_HOME}/xnat_workflow_info \
--server="${server}" \
--username="${username}" \
--password="${password}" \
--workflow-id="${workflow_id}" \
complete
}
# Mark the specified XNAT Workflow as failed
xnat_workflow_fail()
{
local server=${1}
local username=${2}
local password=${3}
local workflow_id=${4}
${XNAT_UTILS_HOME}/xnat_workflow_info \
--server="${server}" \
--username="${username}" \
--password="${password}" \
--workflow-id="${workflow_id}" \
fail
}