Skip to content

Commit

Permalink
fix task 9) in #1081
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobuzzi committed Feb 4, 2020
1 parent 355c155 commit 48e117e
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ testExecuteProcess_visaAborted_01

self assert: ((procDefinition getCollectionForFieldsNamed: 'citizenName[s]' in: 'citizen-appliance') select: [:fieldValue | fieldValue processId = processId]) notEmpty.
self assert: ((procDefinition getCollectionForFieldsNamed: 'citizenSurname[s]' in: 'citizen-appliance') select: [:fieldValue | fieldValue processId = processId]) notEmpty.
self assert: procInstance isRunning.
"here the process is cancelled"
procInstance abortProcess: nil.
procInstance currentState isConfirmed: true.
Expand All @@ -30,4 +31,5 @@ testExecuteProcess_visaAborted_01
self assert: (finishedProcessMatrix getAvailableTasksFor: 'visa officer' satisfying: {:assign | assign.processId = processId}) isEmpty.
self assert: (procDefinition hasAbortedProcess: processId).
self assert: ((procDefinition getCollectionForFieldsNamed: 'citizenName[s]' in: 'citizen-appliance') select: [:fieldValue | fieldValue processId = processId]) isEmpty.
self assert: ((procDefinition getCollectionForFieldsNamed: 'citizenSurname[s]' in: 'citizen-appliance') select: [:fieldValue | fieldValue processId = processId]) isEmpty.
self assert: ((procDefinition getCollectionForFieldsNamed: 'citizenSurname[s]' in: 'citizen-appliance') select: [:fieldValue | fieldValue processId = processId]) isEmpty.
self deny: procInstance isRunning.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ testExecuteProcess_visaAborted_02
self assert: ((finishedProcessMatrix getAvailableTasksFor: 'visa officer' satisfying: {:assign | assign.processId = processId}) size = 2).

assignment := self processExecutionSimulator takeTask: currentTask forUserNamed: 'andrew vm' withForm: self formInstance_check_previous_appliance on: procInstance.

self assert: procInstance isRunning.
"here the process is cancelled"
procInstance abortProcess: nil.
procInstance currentState isConfirmed: true.
Expand All @@ -51,4 +51,5 @@ testExecuteProcess_visaAborted_02
self assert: ((procDefinition getCollectionForFieldsNamed: 'citizenName[s]' in: 'citizen-appliance') select: [:fieldValue | fieldValue processId = processId]) isEmpty.
self assert: ((procDefinition getCollectionForFieldsNamed: 'citizenSurname[s]' in: 'citizen-appliance') select: [:fieldValue | fieldValue processId = processId]) isEmpty.
self assert: ((procDefinition getCollectionForFieldsNamed: 'originCountry[s]' in: 'check-basic-data') select: [:fieldValue | fieldValue processId = processId]) isEmpty.
self assert: ((procDefinition getCollectionForFieldsNamed: 'gender[s]' in: 'check-basic-data') select: [:fieldValue | fieldValue processId = processId]) isEmpty.
self assert: ((procDefinition getCollectionForFieldsNamed: 'gender[s]' in: 'check-basic-data') select: [:fieldValue | fieldValue processId = processId]) isEmpty.
self deny: procInstance isRunning.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ testExecuteProcess_visaAborted_03
"Step 3 - Gateway Evaluation"
gateway := procInstance executedGateways asOrderedCollection last.
self assert: (gateway getDefinitionName = 'accept basic data').

self assert: procInstance isRunning.
"Step 4 - Form [check-previous-appliance]"
currentTask := procInstance currentActivities last.
self assert: (currentTask getDefinitionName = 'check-previous-appliance').
Expand All @@ -53,6 +53,7 @@ testExecuteProcess_visaAborted_03
subProcCurrentMatrix := subProcessL1 getAvailableProcessMatrix.
subProcFinishedMatrix := subProcessL1 getFinishedProcessMatrix.

self assert: subProcessL1 isRunning.
self assert: (procInstance includesSubProcess: subProcessL1).
self assert: subProcessL1 isSubProcess.
self assert: (subProcessL1 startEvent getDefinitionName = 'start visa check').
Expand Down Expand Up @@ -81,6 +82,9 @@ testExecuteProcess_visaAborted_03

"Sub Process Execution [check-financial-data]"
subProcessL2 := subProcessL1 subprocesses last.
self assert: procInstance isRunning.
self assert: subProcessL1 isRunning.
self assert: subProcessL2 isRunning.
subProc2Id := subProcessL2 id.
subProc2CurrentMatrix := subProcessL2 getAvailableProcessMatrix.
subProc2FinishedMatrix := subProcessL2 getFinishedProcessMatrix.
Expand Down Expand Up @@ -152,11 +156,16 @@ testExecuteProcess_visaAborted_03

assignment := self processExecutionSimulator takeTask: currentTask forUserNamed: 'andrew vm' withForm: self formInstance_emit_visa on: procInstance.

self assert: procInstance isRunning.
self deny: subProcessL1 isRunning.
self deny: subProcessL2 isRunning.
"here the process is cancelled"
procInstance abortProcess: nil.
procInstance currentState isConfirmed: true.
procInstance confirmAbortion.

self deny: procInstance isRunning.

self assert: (procDefinition hasAbortedProcess: processId).
self assert: (currentProcessMatrix getAvailableTasksFor: 'visa manager' satisfying: {:assign | assign.processId = processId}) isEmpty.
self assert: (takenProcessMatrix getAvailableTasksFor: 'visa manager' satisfying: {:assign | assign.processId = processId}) isEmpty.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,18 @@ testExecuteProcess_visaAborted_SubProc_L1_01

self assert: ((subProcFinishedMatrix getAvailableTasksFor: 'visa checker' satisfying: {:assign | assign.processId = subProcId}) size = 1).
self assert: ((subProcessL1 definition getCollectionForFieldsNamed: 'checkApplicantRecord[s]' in: 'check-applicant-record') select: [:fieldValue | fieldValue processId = subProcId]) notEmpty.

self assert: procInstance isRunning.
self assert: subProcessL1 isRunning.

"here the process is cancelled"
subProcessL1 abortProcess: nil.
subProcessL1 currentState isConfirmed: true.
subProcessL1 confirmAbortion. "cancel all process tree -sub processes and the top process-"

self deny: procInstance isRunning.
self deny: subProcessL1 isRunning.

self assert: (subProcessL1 definition hasAbortedProcess: subProcId).
self assert: (subProcCurrentMatrix getAvailableTasksFor: 'visa checker' satisfying: {:assign | assign.processId = subProcId}) isEmpty.
self assert: (subProcFinishedMatrix getAvailableTasksFor: 'visa checker' satisfying: {:assign | assign.processId = subProcId}) isEmpty.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,19 @@ testExecuteProcess_visaAborted_SubProc_L2_01
currentTask := subProcessL2 currentActivities last.
self assert: (currentTask getDefinitionName = 'financial-report').

self assert: procInstance isRunning.
self assert: subProcessL1 isRunning.
self assert: subProcessL2 isRunning.

"here the process is cancelled"
subProcessL1 abortProcess: nil.
subProcessL1 currentState isConfirmed: true.
subProcessL1 confirmAbortion. "cancel all process tree -sub processes and the top process-"

self deny: procInstance isRunning.
self deny: subProcessL1 isRunning.
self deny: subProcessL2 isRunning.

self assert: (subProcessL2 definition hasAbortedProcess: subProc2Id).
self assert: (subProcCurrentMatrix getAvailableTasksFor: 'finance officer' satisfying: {:assign | assign.processId = subProcId}) isEmpty.
self assert: (subProcFinishedMatrix getAvailableTasksFor: 'finance officer' satisfying: {:assign | assign.processId = subProcId}) isEmpty.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ testExecuteProcess_visaAcceptedPaused01

"TEST Paused Process"
procInstance pauseProcess: nil. "the process is Paused"
self deny: procInstance isRunning.
self assert: procInstance isPaused.

[self processExecutionSimulator takeAndFinalizeTask: currentTask withUserNamed: 'andrew vo' withForm: self formInstance_check_basic_data on: procInstance] on: ProcessNotRunningException do: [:ex | self assert: true].

procInstance resumeProcess: nil.
self assert: procInstance isRunning.
self deny: procInstance isPaused.

"Step 2 - Form [check-basic-data]"
self assert: (currentProcessMatrix getAvailableTasksFor: 'visa officer' satisfying: {:assign | assign.processId = processId}) notEmpty.
Expand All @@ -42,6 +46,7 @@ testExecuteProcess_visaAcceptedPaused01

[self processExecutionSimulator takeAndFinalizeTask: currentTask withUserNamed: 'andrew vm' withForm: self formInstance_check_previous_appliance on: procInstance] on: ProcessNotRunningException do: [:ex | self assert: true].

self deny: procInstance isRunning.
self assert: procInstance isPaused.
procInstance resumeProcess: nil.
self assert: procInstance isRunning.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
"testAndExecutionContext_4" : "brunobb 08/08/2019 12:49",
"testExecuteProcess_issue_366" : "brunobb 11/09/2018 10:01",
"testExecuteProcess_issue_373" : "brunobb 03/25/2019 09:08",
"testExecuteProcess_visaAborted_01" : "brunobb 11/09/2018 10:04",
"testExecuteProcess_visaAborted_02" : "brunobb 11/09/2018 10:04",
"testExecuteProcess_visaAborted_03" : "brunobb 11/09/2018 10:05",
"testExecuteProcess_visaAborted_SubProc_L1_01" : "brunobb 11/09/2018 10:06",
"testExecuteProcess_visaAborted_SubProc_L2_01" : "brunobb 11/09/2018 10:07",
"testExecuteProcess_visaAborted_01" : "brunobb 02/04/2020 07:07",
"testExecuteProcess_visaAborted_02" : "brunobb 02/04/2020 07:08",
"testExecuteProcess_visaAborted_03" : "brunobb 02/04/2020 07:13",
"testExecuteProcess_visaAborted_SubProc_L1_01" : "brunobb 02/04/2020 07:19",
"testExecuteProcess_visaAborted_SubProc_L2_01" : "brunobb 02/04/2020 07:22",
"testExecuteProcess_visaAccepted" : "brunobb 11/09/2018 10:08",
"testExecuteProcess_visaAcceptedPaused01" : "brunobb 02/01/2020 10:24",
"testExecuteProcess_visaAcceptedPaused01" : "brunobb 02/04/2020 07:26",
"testExecuteProcess_visaAccepted_02" : "brunobb 11/08/2018 08:07",
"testExecuteProcess_visaAccepted_03" : "brunobb 11/09/2018 10:08",
"testExecuteProcess_visaAccepted_04" : "brunobb 11/09/2018 10:17",
Expand Down

Large diffs are not rendered by default.

0 comments on commit 48e117e

Please sign in to comment.