Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-and-itasks
clean-libraries
Commits
1f18e60c
Commit
1f18e60c
authored
May 02, 2008
by
Rinus Plasmeijer
Browse files
*** empty log message ***
parent
5da94885
Changes
2
Hide whitespace changes
Inline
Side-by-side
libraries/iTasks/iTasksProcessHandling.dcl
View file @
1f18e60c
...
...
@@ -20,15 +20,14 @@ derive write Wid
::
Wid
a
// reference to a workflow process
::
WorkflowStatus
=
WflActive
// iTask workflow process is still being processed
|
WflSuspended
//
it is (temporally) suspended
::
WorkflowStatus
=
WflActive
UserId
// iTask workflow process is still being processed
by indicated user
|
WflSuspended
UserId
// it is assigned to indicated user but
it is (temporally) suspended
|
WflFinished
// it is finshed
|
WflDeleted
// it does not exist anymore because it is deleted
instance
==
WorkflowStatus
/* iTask Workflow process management:
spawnWorkflow :: spawn an iTask workflow as a new separate process, Wid is a handle to that process, bool indicates whether it is active or suspended
waitForWorkflow :: wait until the indicated process is finished and obtain the resulting value; returns Nothing when process is deleted
getWorkflowStatus :: get status of workflow
...
...
libraries/iTasks/iTasksProcessHandling.icl
View file @
1f18e60c
...
...
@@ -28,8 +28,8 @@ derive write Wid, WorkflowStatus
instance
==
WorkflowStatus
where
(==)
WflActive
WflActive
=
True
(==)
WflSuspended
WflSuspended
=
True
(==)
(
WflActive
_)
(
WflActive
_)
=
True
(==)
(
WflSuspended
_)
(
WflSuspended
_)
=
True
(==)
WflFinished
WflFinished
=
True
(==)
WflDeleted
WflDeleted
=
True
(==)
_
_
=
False
...
...
@@ -171,6 +171,8 @@ where
#
(
wfls
,
tst
)
=
workflowProcessStore
(\_
->
(
maxid
,
nwfls
))
tst
// update workflow process administration
=
(
True
,
tst
)
// if everything is fine it should always succeed
waitForWorkflow
::
!(
Wid
a
)
->
Task
(
Maybe
a
)
|
iData
a
waitForWorkflow
(
Wid
(
entry
,
ids
=:(_,_,
label
)))
=
newTask
(
"waiting for "
+++
label
)
waitForResult`
where
...
...
@@ -264,10 +266,10 @@ where
#
refok
=
isValidWorkflowReference
wfl
ids
|
not
refok
=
(
WflDeleted
,
tst
)
// wid does not refer to the correct entry anymore
#
status
=
case
wfl
of
(
ActiveWorkflow
_
_)
->
WflActive
(
SuspendedWorkflow
_
_)
->
WflSuspended
(
FinishedWorkflow
_
_
_)
->
WflFinished
(
DeletedWorkflow
_)
->
WflDeleted
(
ActiveWorkflow
(
user
,_,_)
_)
->
WflActive
user
(
SuspendedWorkflow
(
user
,_,_)
_)
->
WflSuspended
user
(
FinishedWorkflow
_
_
_)
->
WflFinished
(
DeletedWorkflow
_)
->
WflDeleted
=
(
status
,
tst
)
// if everything is fine it should always succeed
showWorkflows
::
!
Bool
!*
TSt
->
(![
BodyTag
],*
TSt
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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