-
Notifications
You must be signed in to change notification settings - Fork 8
/
create_email_message.cwl
69 lines (53 loc) · 1.47 KB
/
create_email_message.cwl
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
#!/usr/bin/env cwl-runner
$namespaces:
s: https://schema.org/
s:author:
- class: s:Person
s:identifier: https://orcid.org/0000-0002-0326-7494
s:email: [email protected]
s:name: Andrew Lamb
cwlVersion: v1.0
class: ExpressionTool
requirements:
- class: InlineJavascriptRequirement
inputs:
- id: status
type: string
- id: evaluation_name
type: string
- id: submissionid
type: int
- id: submission_name
type: string
- id: invalid_reason_string
type: string
- id: annotation_string
type: string
outputs:
- id: body
type: string
- id: subject
type: string
expression: |
${
var subject = "Submission to " + inputs.evaluation_name + " processed."
if(inputs.status == "VALIDATED"){
var body = "Your submission is valid!"
} else if(inputs.status == "INVALID"){
var body = "Your submission is invalid, below are the reason(s):\n\n" +
inputs.invalid_reason_string
} else {
var body = "Your submission has been scored, below are your result(s):\n\n" +
inputs.annotation_string.split(";").join("\n").split(":").join(" ") +
"\n\n\n"
}
body = "Hello participant,\n\n" +
body +
"\nSubmission ID: " +
inputs.submissionid +
"\nSubmission name: " +
inputs.submission_name +
"\n\n\nSincerely," +
"\nChallenge Administrator"
return {body: body, subject: subject}
}