Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
iTasks-SDK
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
73
Issues
73
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clean-and-itasks
iTasks-SDK
Commits
3c9f88a5
Commit
3c9f88a5
authored
Mar 05, 2019
by
Steffen Michels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
introduce >-| as abbreviation for '>>- \_ ->'
parent
e78e2b49
Pipeline
#19606
passed with stage
in 4 minutes and 43 seconds
Changes
11
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
33 additions
and
23 deletions
+33
-23
Examples/Applications/Incidone/Incidone/ActionManagementTasks.icl
.../Applications/Incidone/Incidone/ActionManagementTasks.icl
+1
-1
Examples/Applications/Incidone/Incidone/OP/ContactManagementTasks.icl
...lications/Incidone/Incidone/OP/ContactManagementTasks.icl
+6
-6
Examples/Applications/Incidone/Incidone/OP/DemonstrationTasks.icl
.../Applications/Incidone/Incidone/OP/DemonstrationTasks.icl
+3
-3
Examples/Applications/Incidone/Incidone/RoleBased/AdministratorTasks.icl
...ations/Incidone/Incidone/RoleBased/AdministratorTasks.icl
+2
-2
Examples/Applications/Incidone/Incidone/Simulation/TrainingTasks.icl
...plications/Incidone/Incidone/Simulation/TrainingTasks.icl
+1
-1
Examples/BasicAPIExamples/MultiUserExamples/MeetingDate.icl
Examples/BasicAPIExamples/MultiUserExamples/MeetingDate.icl
+2
-2
Libraries/iTasks/Extensions/Development/Testing.icl
Libraries/iTasks/Extensions/Development/Testing.icl
+1
-1
Libraries/iTasks/Internal/Tonic/Server.icl
Libraries/iTasks/Internal/Tonic/Server.icl
+1
-1
Libraries/iTasks/WF/Combinators/Common.dcl
Libraries/iTasks/WF/Combinators/Common.dcl
+10
-0
Libraries/iTasks/WF/Combinators/Common.icl
Libraries/iTasks/WF/Combinators/Common.icl
+1
-1
Tools/CodeQualityMonitor.icl
Tools/CodeQualityMonitor.icl
+5
-5
No files found.
Examples/Applications/Incidone/Incidone/ActionManagementTasks.icl
View file @
3c9f88a5
...
...
@@ -806,7 +806,7 @@ where
importJSONDocument
doc
>>-
\
actions
->
set
actions
userActionCatalog
>
>-
\_
->
viewInformation
()
[]
"Succesfully imported action catalog"
@!
()
>
-|
viewInformation
()
[]
"Succesfully imported action catalog"
@!
()
)
(\
e
->
viewInformation
"Failed import action catalog"
[]
e
@!
())
)
<<@
Title
"Import actions"
where
...
...
Examples/Applications/Incidone/Incidone/OP/ContactManagementTasks.icl
View file @
3c9f88a5
...
...
@@ -496,19 +496,19 @@ addContactPhoto contactNo original
=
withTemporaryDirectory
\
tmp
->
exportDocument
(
tmp
</>
"orig.jpg"
)
original
>
>-
\_
->
>
-|
callProcess
"Creating thumbnail..."
[]
CONVERT_BIN
[
"-define"
,
"jpeg:size=400x400"
,(
tmp
</>
"orig.jpg"
),
"-thumbnail"
,
"200x200^"
,
"-gravity"
,
"center"
,
"-extent"
,
"200x200"
,(
tmp
</>
"thumb.png"
)]
Nothing
Nothing
>
>-
\_
->
>
-|
importDocument
(
tmp
</>
"thumb.png"
)
>>-
\
thumb
->
callProcess
"Creating avatar..."
[]
CONVERT_BIN
[
"-define"
,
"jpeg:size=100x100"
,(
tmp
</>
"orig.jpg"
),
"-thumbnail"
,
"50x50^"
,
"-gravity"
,
"center"
,
"-extent"
,
"50x50"
,(
tmp
</>
"avatar.png"
)]
Nothing
Nothing
>
>-
\_
->
>
-|
importDocument
(
tmp
</>
"avatar.png"
)
>>-
\
avatar
->
let
photo
=
{
ContactPhoto
|
original
=
original
,
thumb
=
thumb
,
avatar
=
avatar
}
in
upd
(\
photos
->
'
DM
'.
put
contactNo
[
photo
:
fromMaybe
[]
('
DM
'.
get
contactNo
photos
)]
photos
)
allContactPhotos
>
>-
\_
->
>
-|
logContactPhotoAdded
contactNo
photo
@!
photo
...
...
@@ -526,7 +526,7 @@ createCommunicationMean contactNo mean=:{NewCommunicationMean|type,phoneNo,callS
sqlExecute
db
[
"allCommunicationMeans"
]
(
execInsert
"INSERT INTO CommunicationMean (type) VALUES (?)"
(
toSQL
type
))
>>-
\
id
->
sqlExecute
db
[]
(
execInsert
"INSERT INTO communicationMeans1_communicationMeans2 (communicationMeans1,communicationMeans2) VALUES (?,?)"
(
toSQL
id
++
toSQL
contactNo
))
>
>-
\_
->
case
type
of
>
-|
case
type
of
CMPhone
=
sqlExecute
db
[]
(
execInsert
"INSERT INTO Telephone (id,phoneNo) VALUES (?,?)"
(
toSQL
id
++
mbToSQL
phoneNo
))
CMVHF
=
sqlExecute
db
[]
(
execInsert
"INSERT INTO VHFRadio (id,callSign,mmsi) VALUES (?,?,?)"
(
toSQL
id
++
mbToSQL
callSign
++
mbToSQL
mmsi
))
CMEmail
=
sqlExecute
db
[]
(
execInsert
"INSERT INTO EmailAccount (id,emailAddress) VALUES (?,?)"
(
toSQL
id
++
mbToSQL
emailAddress
))
...
...
@@ -537,7 +537,7 @@ deleteCommunicationMean id
=
get
databaseDef
>>-
\
db
->
sqlExecute
db
[
"allCommunicationMeans"
]
(
execDelete
"DELETE FROM communicationMeans1_communicationMeans2 WHERE communicationMeans1 = ? "
(
toSQL
id
))
>
>-
\_
->
>
-|
allTasks
[
sqlExecute
db
[]
(
execDelete
(
"DELETE FROM "
+++
table
+++
" WHERE id = ? "
)
(
toSQL
id
))
\\
table
<-
[
"CommunicationMean"
,
"Telephone"
,
"VHFRadio"
,
"EmailAccount"
,
"P2000Receiver"
]]
@!
()
...
...
Examples/Applications/Incidone/Incidone/OP/DemonstrationTasks.icl
View file @
3c9f88a5
...
...
@@ -18,10 +18,10 @@ generateTestIncident closed
get
(
sdsFocus
"Watch officers"
contactsWithGroupShort
)
>>-
randomChoice
>>-
\
wo
->
linkContactsToIncident
[
vesselNo
,
wo
.
ContactShort
.
contactNo
]
incidentNo
>
>-
\_
->
>
-|
//Create first call
createFirstCall
vesselNo
wo
incidentNo
>
>-
\_
->
>
-|
if
closed
(
closeIncident
incidentNo
@!
incidentNo
)
(
return
incidentNo
)
where
makeupTroubleVessel
::
IncidentType
->
Task
NewContact
...
...
@@ -50,7 +50,7 @@ where
=
createCommunication
RadioCall
In
(
Just
caller
)
>>-
\
communicationNo
->
upd
update
(
sdsFocus
communicationNo
communicationDetailsByNo
)
>
>-
\_
->
>
-|
logCommunicationResponded
communicationNo
@!
communicationNo
where
...
...
Examples/Applications/Incidone/Incidone/RoleBased/AdministratorTasks.icl
View file @
3c9f88a5
...
...
@@ -153,7 +153,7 @@ where
importUsers
=
doOrClose
(
enterInformation
instructions
[]
>>=
\
doc
->
catchAll
(
importContactsFromCSVFile
doc
>
>-
\_
->
viewInformation
()
[]
"Succesfully imported contacts"
>>|
return
()
importContactsFromCSVFile
doc
>
-|
viewInformation
()
[]
"Succesfully imported contacts"
>>|
return
()
)
(\_
->
viewInformation
"Failed to import contacts"
[]
())
)
<<@
Title
"Import contacts"
where
...
...
@@ -254,7 +254,7 @@ where
importJSONDocument
doc
>>-
\
config
->
set
config
webLinksConfig
>
>-
\_
->
viewInformation
()
[]
"Succesfully imported web links"
@!
()
>
-|
viewInformation
()
[]
"Succesfully imported web links"
@!
()
)
(\
e
->
viewInformation
"Failed import of web links"
[]
e
@!
())
)
<<@
Title
"Import web links"
where
...
...
Examples/Applications/Incidone/Incidone/Simulation/TrainingTasks.icl
View file @
3c9f88a5
...
...
@@ -39,7 +39,7 @@ where
/*
>>- \now -> let updateTime = nextUpdate now in
waitForTime updateTime
>
>- \_ ->
let fileName = (contentDir </> updatesFile updateTime) in
>
-|
let fileName = (contentDir </> updatesFile updateTime) in
importTextFile fileName
>>- \content ->
injectAISUpdates fileName (split "\n" content)
...
...
Examples/BasicAPIExamples/MultiUserExamples/MeetingDate.icl
View file @
3c9f88a5
...
...
@@ -71,8 +71,8 @@ where
=
[{
users
=
[],
date
=
date
}
\\
date
<-
dates
]
askAll
table
=
allTasks
[(
user
,
purpose
)
@:
checkOptions
(
toString
user
)
\\
user
<-
others
]
>
>-
\_
->
enterChoiceWithShared
"Select the date for the meeting:"
[
ChooseFromGrid
id
]
table
=
allTasks
[(
user
,
purpose
)
@:
checkOptions
(
toString
user
)
\\
user
<-
others
]
>
-|
enterChoiceWithShared
"Select the date for the meeting:"
[
ChooseFromGrid
id
]
table
>>=
viewInformation
"Date chosen:"
[]
where
checkOptions
user
...
...
Libraries/iTasks/Extensions/Development/Testing.icl
View file @
3c9f88a5
...
...
@@ -19,7 +19,7 @@ derive gEq EndEvent, FailReason, FailedAssertion, CounterExample, Relation
compileTestModule
::
CleanModuleName
->
Task
EndEvent
compileTestModule
(
path
,
name
)
=
copyFile
prjDefaultPath
prjPath
>
>-
\_
->
get
cpmExecutable
>
-|
get
cpmExecutable
>>-
\
cpm
->
runWithOutput
cpm
[
prjPath
]
Nothing
//Build the test
@
\(
c
,
o
)
->
if
(
passed
c
o
)
{
name
=
testName
,
event
=
Passed
,
message
=
join
""
o
}
...
...
Libraries/iTasks/Internal/Tonic/Server.icl
View file @
3c9f88a5
...
...
@@ -205,7 +205,7 @@ where
=
get
tonicServerShare
>>-
\
ts
->
get
currentDateTime
>>-
\
cdt
->
upd
('
DM
'.
put
cdt
ts
.
ts_recordingBuffer
)
recordingsShare
>
>-
\_
->
upd
(\
ts
->
{
ts
&
ts_recording
=
False
})
tonicServerShare
@!
()
>
-|
upd
(\
ts
->
{
ts
&
ts_recording
=
False
})
tonicServerShare
@!
()
refreshAction
::
TaskCont
a
(
Task
())
refreshAction
=
OnAction
(
Action
"Refresh"
)
(
always
startViewer
)
...
...
Libraries/iTasks/WF/Combinators/Common.dcl
View file @
3c9f88a5
...
...
@@ -54,6 +54,16 @@ tbind :: !(Task a) !(a -> Task b) -> Task b | iTask a & iTask b
*/
(>>-)
infixl
1
::
!(
Task
a
)
!(
a
->
Task
b
)
->
Task
b
|
iTask
a
&
iTask
b
/**
* Combines two tasks sequentially but continues only when the first task has a stable value.
*
* @param First: The first task to be executed
* @param Second: The second task
* @return The combined task
* @type (Task a) (Task b) -> Task b | iTask a & iTask b
*/
(>-|)
infixl
1
(>-|)
x
y
:==
x
>>-
\_
->
y
/**
* Combines two tasks sequentially but continues only when the first task has a value.
*
* @param First: The first task to be executed
...
...
Libraries/iTasks/WF/Combinators/Common.icl
View file @
3c9f88a5
...
...
@@ -104,7 +104,7 @@ sequence tasks = foreverStIf
foreverStIf
::
(
a
->
Bool
)
a
!(
a
->
Task
a
)
->
Task
a
|
iTask
a
foreverStIf
pred
st
t
=
parallel
[(
Embedded
,
par
st
Nothing
)]
[]
@?
fromParValue
where
par
st
(
Just
tid
)
tlist
=
removeTask
tid
tlist
>
>-
\_->
par
st
Nothing
tlist
par
st
(
Just
tid
)
tlist
=
removeTask
tid
tlist
>
-|
par
st
Nothing
tlist
par
st
Nothing
tlist
|
not
(
pred
st
)
=
treturn
st
=
step
...
...
Tools/CodeQualityMonitor.icl
View file @
3c9f88a5
...
...
@@ -217,13 +217,13 @@ where
get
state
@
(\{
InspectState
|
moduleName
,
lines
}
->
(
moduleName
,
join
OS_NEWLINE
lines
))
>>-
\(
moduleName
,
sourceCode
)
->
prepareBuildFiles
temporaryDirectory
moduleName
sourceCode
>
>-
\_
->
runBuildTool
temporaryDirectory
moduleName
>
>-
\_
->
setExecutable
temporaryDirectory
moduleName
state
>
-|
runBuildTool
temporaryDirectory
moduleName
>
-|
setExecutable
temporaryDirectory
moduleName
state
@!
()
where
prepareBuildFiles
directory
moduleName
sourceCode
=
exportTextFile
(
directory
</>
addExtension
moduleName
"icl"
)
sourceCode
>
>-
\_
->
exportTextFile
(
directory
</>
addExtension
moduleName
"prj"
)
(
projectTemplate
moduleName
)
=
exportTextFile
(
directory
</>
addExtension
moduleName
"icl"
)
sourceCode
>
-|
exportTextFile
(
directory
</>
addExtension
moduleName
"prj"
)
(
projectTemplate
moduleName
)
runBuildTool
directory
moduleName
=
get
cpmExecutable
...
...
@@ -239,7 +239,7 @@ where
>>-
maybe
(
throw
"Cannot run the program. There is no executable yet"
)
(\
executable
->
makeExecutable
executable
>
>-
\_
->
callProcess
()
[
ViewAs
view
]
executable
[
"-port"
,
"8084"
]
(
Just
temporaryDirectory
)
Nothing
>
-|
callProcess
()
[
ViewAs
view
]
executable
[
"-port"
,
"8084"
]
(
Just
temporaryDirectory
)
Nothing
>>*
[
OnAction
ActionClose
(
always
(
return
()))]
//Pause after command...
)
)
@!
()
...
...
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