diff --git a/OnlineSchuhDemo/dsl_matching/Testcollection1.bpmn-testgen b/OnlineSchuhDemo/dsl_matching/Testcollection1.bpmn-testgen new file mode 100644 index 0000000000000000000000000000000000000000..34f6ee65cd40e4262215d8bf97c496cbffa9bbbd --- /dev/null +++ b/OnlineSchuhDemo/dsl_matching/Testcollection1.bpmn-testgen @@ -0,0 +1,161 @@ +BPMNDiagram process +with testpackage "de.sample.onlineschuhdemo" with bpmn "retoure.bpmn" with key "Retoure" with dmn : [ "\\schuh_vernichtung_spende.dmn" ] with embedded : [ "\\forms\\warendaten-erfassen-form.html" ] ; + +Loop Loop0 +starts with "Gateway_Einpackung_Fehlerhaft" +follows by "Gateway_Auspacken" +ends with "Gateway_Einpackung_Fehlerhaft_Closed" +has complexity 2 passed : [ 0 , 1 ] ; + +FlowElement Retoure_Start : StartEvent with inputVariables : [ kundennummer , erstattung , beschaedigt ] ; +FlowElement Flow_Start : SequenceFlow ; +FlowElement Gateway_Parallel_Lager_Neusendung : Gateway ; +FlowElement Flow_0eh02jo : SequenceFlow ; +FlowElement Gateway_Beschaedigt : Gateway ; +FlowElement Flow_unbeschaedigt : SequenceFlow ; +FlowElement Ware_einsortieren : ManualTask ; +FlowElement Flow_0a9rzst : SequenceFlow ; +FlowElement Gateway_Beschaedigt_Close : Gateway ; +FlowElement Flow_1c2tfla : SequenceFlow ; +FlowElement Flow_1gu0k49 : SequenceFlow ; +FlowElement Kundendaten_ermitteln : ServiceTask with external : customer ; +FlowElement Flow_0iibopi : SequenceFlow ; +FlowElement Gateway_Neusendung : Gateway ; +FlowElement Flow_Erstattung : SequenceFlow with expression : "#{erstattung}" ; +FlowElement Finanzdaten_ermitteln : ServiceTask with external : financial with hardcoded inputs : [ serviceIdentifier = "getData" ] ; +FlowElement Flow_Erstattung_Datenermittlung : SequenceFlow ; +FlowElement Erstattung : ServiceTask with external : financial with hardcoded inputs : [ serviceIdentifier = "refund" ] ; +FlowElement Flow_Erstattung_abgeschlossen : SequenceFlow ; +FlowElement Gateway_Neusendung_Closed : Gateway ; +FlowElement Flow_0m33odz : SequenceFlow ; +FlowElement Gateway_Parallel_Lager_Neusendung_Closed : Gateway ; +FlowElement Flow_Ende : SequenceFlow ; +FlowElement Retoure_Ende : EndEvent ; +FlowElement Flow_neusenden : SequenceFlow ; +FlowElement Manuelle_Pruefung : UserTask ; +FlowElement Flow_0u77zm0 : SequenceFlow ; +FlowElement Warennummer_ermitteln : ServiceTask with delegate : "warennummer" ; +FlowElement Flow_03ubi3l : SequenceFlow ; +FlowElement Gateway_Einpackung_Fehlerhaft_Closed : Gateway ; +FlowElement Flow_006t3wo : SequenceFlow ; +FlowElement Paket_packen : UserTask with inputVariables : [ pakettyp ] ; +FlowElement Flow_0bhr7g8 : SequenceFlow ; +FlowElement Paket_pruefen : UserTask with inputVariables : [ paket ] ; +FlowElement Flow_1n6o3h6 : SequenceFlow ; +FlowElement Gateway_Einpackung_Fehlerhaft : Gateway ; +FlowElement Flow_paket_okay : SequenceFlow ; +FlowElement Paket_senden : UserTask ; +FlowElement Flow_0u4n4gn : SequenceFlow ; +FlowElement Flow_fehlerhaft_eingepackt : SequenceFlow with expression : "#{paket==false}" ; +FlowElement Gateway_Auspacken : Gateway ; +FlowElement Flow_normal_auspacken : SequenceFlow with expression : "#{pakettyp==\"Normalverpackung\"}" ; +FlowElement Ware_auspacken_normal : ManualTask ; +FlowElement Flow_0d8lhxo : SequenceFlow ; +FlowElement Gateway_14evkap : Gateway ; +FlowElement Flow_1bnro90 : SequenceFlow ; +FlowElement Flow_luxus_auspacken : SequenceFlow with expression : "#{pakettyp==\"Luxusverpackung\"}" ; +FlowElement Ware_auspacken_luxus : ManualTask ; +FlowElement Flow_04tyvq1 : SequenceFlow ; +FlowElement Flow_beschaedigt : SequenceFlow with expression : "#{beschaedigt == true}" ; +FlowElement Warendaten_erfassen : UserTask with inputVariables : [ marke , preis ] ; +FlowElement Flow_01lf19r : SequenceFlow ; +FlowElement Vernichtung_ermitteln : BusinessRuleTask ; +FlowElement Flow_0kgxxke : SequenceFlow ; +FlowElement Gateway_Vernichtung : Gateway ; +FlowElement Flow_vernichten : SequenceFlow with expression : "#{vernichten == true}" ; +FlowElement Ware_vernichten : UserTask ; +FlowElement Flow_0zkq7z5 : SequenceFlow ; +FlowElement Gateway_Vernichtung_Close : Gateway ; +FlowElement Flow_14jbtgw : SequenceFlow ; +FlowElement Flow_spenden : SequenceFlow with expression : "#{vernichten == false}" ; +FlowElement Ware_spenden : UserTask ; +FlowElement Flow_0f171gg : SequenceFlow ; + +String kundennummer with proposals : [ ] ; +String marke with proposals : [ "Luxury Foot" , "Simply Shoe" , "Shoe One" ] ; +String iban with proposals : [ ] ; +String vorname with proposals : [ ] ; +String nachname with proposals : [ ] ; +String pakettyp with proposals : [ "Normalverpackung" , "Luxusverpackung" ] ; +String emailGesendet with proposals : [ ] ; +String firstname with proposals : [ ] ; +String lastname with proposals : [ ] ; +String ibanRefund with proposals : [ ] ; +String confirmationEmailSent with proposals : [ ] ; +String serviceIdentifier with proposals : [ "getData" , "refund" ] ; +Integer preis with proposals : [ 350 , 349 , 70 , 71 ] ; +Boolean erstattung with proposals : [ true , false ] ; +Boolean paket with proposals : [ true , false ] ; +Boolean beschaedigt with proposals : [ true , false ] ; + +ExternalTopic customer ; +ExternalTopic financial ; + +Flow Flow_0 for process +with elements : [ Retoure_Start , Flow_Start , Gateway_Parallel_Lager_Neusendung , Flow_0eh02jo , Gateway_Beschaedigt , Flow_unbeschaedigt , Ware_einsortieren , Flow_0a9rzst , Gateway_Beschaedigt_Close , Flow_1c2tfla , Flow_1gu0k49 , Kundendaten_ermitteln , Flow_0iibopi , Gateway_Neusendung , Flow_Erstattung , Finanzdaten_ermitteln , Flow_Erstattung_Datenermittlung , Erstattung , Flow_Erstattung_abgeschlossen , Gateway_Neusendung_Closed , Flow_0m33odz , Gateway_Parallel_Lager_Neusendung_Closed , Flow_Ende , Retoure_Ende ] +without elements : [ Flow_neusenden , Manuelle_Pruefung , Flow_0u77zm0 , Warennummer_ermitteln , Flow_03ubi3l , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_paket_okay , Paket_senden , Flow_0u4n4gn , Flow_fehlerhaft_eingepackt , Gateway_Auspacken , Flow_normal_auspacken , Ware_auspacken_normal , Flow_0d8lhxo , Gateway_14evkap , Flow_1bnro90 , Flow_luxus_auspacken , Ware_auspacken_luxus , Flow_04tyvq1 , Flow_beschaedigt , Warendaten_erfassen , Flow_01lf19r , Vernichtung_ermitteln , Flow_0kgxxke , Gateway_Vernichtung , Flow_vernichten , Ware_vernichten , Flow_0zkq7z5 , Gateway_Vernichtung_Close , Flow_14jbtgw , Flow_spenden , Ware_spenden , Flow_0f171gg ] ; +Flow Flow_1 for process +with elements : [ Retoure_Start , Flow_Start , Gateway_Parallel_Lager_Neusendung , Flow_0eh02jo , Gateway_Beschaedigt , Flow_unbeschaedigt , Ware_einsortieren , Flow_0a9rzst , Gateway_Beschaedigt_Close , Flow_1c2tfla , Flow_1gu0k49 , Kundendaten_ermitteln , Flow_0iibopi , Gateway_Neusendung , Flow_neusenden , Manuelle_Pruefung , Flow_0u77zm0 , Warennummer_ermitteln , Flow_03ubi3l , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_paket_okay , Paket_senden , Flow_0u4n4gn , Gateway_Neusendung_Closed , Flow_0m33odz , Gateway_Parallel_Lager_Neusendung_Closed , Flow_Ende , Retoure_Ende ] +without elements : [ Flow_Erstattung , Finanzdaten_ermitteln , Flow_Erstattung_Datenermittlung , Erstattung , Flow_Erstattung_abgeschlossen , Flow_fehlerhaft_eingepackt , Gateway_Auspacken , Flow_normal_auspacken , Ware_auspacken_normal , Flow_0d8lhxo , Gateway_14evkap , Flow_1bnro90 , Flow_luxus_auspacken , Ware_auspacken_luxus , Flow_04tyvq1 , Flow_beschaedigt , Warendaten_erfassen , Flow_01lf19r , Vernichtung_ermitteln , Flow_0kgxxke , Gateway_Vernichtung , Flow_vernichten , Ware_vernichten , Flow_0zkq7z5 , Gateway_Vernichtung_Close , Flow_14jbtgw , Flow_spenden , Ware_spenden , Flow_0f171gg ] ; +Flow Flow_2 for process +with elements : [ Retoure_Start , Flow_Start , Gateway_Parallel_Lager_Neusendung , Flow_0eh02jo , Gateway_Beschaedigt , Flow_unbeschaedigt , Ware_einsortieren , Flow_0a9rzst , Gateway_Beschaedigt_Close , Flow_1c2tfla , Flow_1gu0k49 , Kundendaten_ermitteln , Flow_0iibopi , Gateway_Neusendung , Flow_neusenden , Manuelle_Pruefung , Flow_0u77zm0 , Warennummer_ermitteln , Flow_03ubi3l , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_fehlerhaft_eingepackt , Gateway_Auspacken , Flow_normal_auspacken , Ware_auspacken_normal , Flow_0d8lhxo , Gateway_14evkap , Flow_1bnro90 , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_paket_okay , Paket_senden , Flow_0u4n4gn , Gateway_Neusendung_Closed , Flow_0m33odz , Gateway_Parallel_Lager_Neusendung_Closed , Flow_Ende , Retoure_Ende ] +without elements : [ Flow_Erstattung , Finanzdaten_ermitteln , Flow_Erstattung_Datenermittlung , Erstattung , Flow_Erstattung_abgeschlossen , Flow_luxus_auspacken , Ware_auspacken_luxus , Flow_04tyvq1 , Flow_beschaedigt , Warendaten_erfassen , Flow_01lf19r , Vernichtung_ermitteln , Flow_0kgxxke , Gateway_Vernichtung , Flow_vernichten , Ware_vernichten , Flow_0zkq7z5 , Gateway_Vernichtung_Close , Flow_14jbtgw , Flow_spenden , Ware_spenden , Flow_0f171gg ] ; +Flow Flow_3 for process +with elements : [ Retoure_Start , Flow_Start , Gateway_Parallel_Lager_Neusendung , Flow_0eh02jo , Gateway_Beschaedigt , Flow_unbeschaedigt , Ware_einsortieren , Flow_0a9rzst , Gateway_Beschaedigt_Close , Flow_1c2tfla , Flow_1gu0k49 , Kundendaten_ermitteln , Flow_0iibopi , Gateway_Neusendung , Flow_neusenden , Manuelle_Pruefung , Flow_0u77zm0 , Warennummer_ermitteln , Flow_03ubi3l , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_fehlerhaft_eingepackt , Gateway_Auspacken , Flow_luxus_auspacken , Ware_auspacken_luxus , Flow_04tyvq1 , Gateway_14evkap , Flow_1bnro90 , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_paket_okay , Paket_senden , Flow_0u4n4gn , Gateway_Neusendung_Closed , Flow_0m33odz , Gateway_Parallel_Lager_Neusendung_Closed , Flow_Ende , Retoure_Ende ] +without elements : [ Flow_Erstattung , Finanzdaten_ermitteln , Flow_Erstattung_Datenermittlung , Erstattung , Flow_Erstattung_abgeschlossen , Flow_normal_auspacken , Ware_auspacken_normal , Flow_0d8lhxo , Flow_beschaedigt , Warendaten_erfassen , Flow_01lf19r , Vernichtung_ermitteln , Flow_0kgxxke , Gateway_Vernichtung , Flow_vernichten , Ware_vernichten , Flow_0zkq7z5 , Gateway_Vernichtung_Close , Flow_14jbtgw , Flow_spenden , Ware_spenden , Flow_0f171gg ] ; +Flow Flow_4 for process +with elements : [ Retoure_Start , Flow_Start , Gateway_Parallel_Lager_Neusendung , Flow_0eh02jo , Gateway_Beschaedigt , Flow_beschaedigt , Warendaten_erfassen , Flow_01lf19r , Vernichtung_ermitteln , Flow_0kgxxke , Gateway_Vernichtung , Flow_vernichten , Ware_vernichten , Flow_0zkq7z5 , Gateway_Vernichtung_Close , Flow_14jbtgw , Gateway_Beschaedigt_Close , Flow_1c2tfla , Flow_1gu0k49 , Kundendaten_ermitteln , Flow_0iibopi , Gateway_Neusendung , Flow_Erstattung , Finanzdaten_ermitteln , Flow_Erstattung_Datenermittlung , Erstattung , Flow_Erstattung_abgeschlossen , Gateway_Neusendung_Closed , Flow_0m33odz , Gateway_Parallel_Lager_Neusendung_Closed , Flow_Ende , Retoure_Ende ] +without elements : [ Flow_unbeschaedigt , Ware_einsortieren , Flow_0a9rzst , Flow_neusenden , Manuelle_Pruefung , Flow_0u77zm0 , Warennummer_ermitteln , Flow_03ubi3l , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_paket_okay , Paket_senden , Flow_0u4n4gn , Flow_fehlerhaft_eingepackt , Gateway_Auspacken , Flow_normal_auspacken , Ware_auspacken_normal , Flow_0d8lhxo , Gateway_14evkap , Flow_1bnro90 , Flow_luxus_auspacken , Ware_auspacken_luxus , Flow_04tyvq1 , Flow_spenden , Ware_spenden , Flow_0f171gg ] ; +Flow Flow_5 for process +with elements : [ Retoure_Start , Flow_Start , Gateway_Parallel_Lager_Neusendung , Flow_0eh02jo , Gateway_Beschaedigt , Flow_beschaedigt , Warendaten_erfassen , Flow_01lf19r , Vernichtung_ermitteln , Flow_0kgxxke , Gateway_Vernichtung , Flow_vernichten , Ware_vernichten , Flow_0zkq7z5 , Gateway_Vernichtung_Close , Flow_14jbtgw , Gateway_Beschaedigt_Close , Flow_1c2tfla , Flow_1gu0k49 , Kundendaten_ermitteln , Flow_0iibopi , Gateway_Neusendung , Flow_neusenden , Manuelle_Pruefung , Flow_0u77zm0 , Warennummer_ermitteln , Flow_03ubi3l , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_paket_okay , Paket_senden , Flow_0u4n4gn , Gateway_Neusendung_Closed , Flow_0m33odz , Gateway_Parallel_Lager_Neusendung_Closed , Flow_Ende , Retoure_Ende ] +without elements : [ Flow_unbeschaedigt , Ware_einsortieren , Flow_0a9rzst , Flow_Erstattung , Finanzdaten_ermitteln , Flow_Erstattung_Datenermittlung , Erstattung , Flow_Erstattung_abgeschlossen , Flow_fehlerhaft_eingepackt , Gateway_Auspacken , Flow_normal_auspacken , Ware_auspacken_normal , Flow_0d8lhxo , Gateway_14evkap , Flow_1bnro90 , Flow_luxus_auspacken , Ware_auspacken_luxus , Flow_04tyvq1 , Flow_spenden , Ware_spenden , Flow_0f171gg ] ; +Flow Flow_6 for process +with elements : [ Retoure_Start , Flow_Start , Gateway_Parallel_Lager_Neusendung , Flow_0eh02jo , Gateway_Beschaedigt , Flow_beschaedigt , Warendaten_erfassen , Flow_01lf19r , Vernichtung_ermitteln , Flow_0kgxxke , Gateway_Vernichtung , Flow_vernichten , Ware_vernichten , Flow_0zkq7z5 , Gateway_Vernichtung_Close , Flow_14jbtgw , Gateway_Beschaedigt_Close , Flow_1c2tfla , Flow_1gu0k49 , Kundendaten_ermitteln , Flow_0iibopi , Gateway_Neusendung , Flow_neusenden , Manuelle_Pruefung , Flow_0u77zm0 , Warennummer_ermitteln , Flow_03ubi3l , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_fehlerhaft_eingepackt , Gateway_Auspacken , Flow_normal_auspacken , Ware_auspacken_normal , Flow_0d8lhxo , Gateway_14evkap , Flow_1bnro90 , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_paket_okay , Paket_senden , Flow_0u4n4gn , Gateway_Neusendung_Closed , Flow_0m33odz , Gateway_Parallel_Lager_Neusendung_Closed , Flow_Ende , Retoure_Ende ] +without elements : [ Flow_unbeschaedigt , Ware_einsortieren , Flow_0a9rzst , Flow_Erstattung , Finanzdaten_ermitteln , Flow_Erstattung_Datenermittlung , Erstattung , Flow_Erstattung_abgeschlossen , Flow_luxus_auspacken , Ware_auspacken_luxus , Flow_04tyvq1 , Flow_spenden , Ware_spenden , Flow_0f171gg ] ; +Flow Flow_7 for process +with elements : [ Retoure_Start , Flow_Start , Gateway_Parallel_Lager_Neusendung , Flow_0eh02jo , Gateway_Beschaedigt , Flow_beschaedigt , Warendaten_erfassen , Flow_01lf19r , Vernichtung_ermitteln , Flow_0kgxxke , Gateway_Vernichtung , Flow_vernichten , Ware_vernichten , Flow_0zkq7z5 , Gateway_Vernichtung_Close , Flow_14jbtgw , Gateway_Beschaedigt_Close , Flow_1c2tfla , Flow_1gu0k49 , Kundendaten_ermitteln , Flow_0iibopi , Gateway_Neusendung , Flow_neusenden , Manuelle_Pruefung , Flow_0u77zm0 , Warennummer_ermitteln , Flow_03ubi3l , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_fehlerhaft_eingepackt , Gateway_Auspacken , Flow_luxus_auspacken , Ware_auspacken_luxus , Flow_04tyvq1 , Gateway_14evkap , Flow_1bnro90 , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_paket_okay , Paket_senden , Flow_0u4n4gn , Gateway_Neusendung_Closed , Flow_0m33odz , Gateway_Parallel_Lager_Neusendung_Closed , Flow_Ende , Retoure_Ende ] +without elements : [ Flow_unbeschaedigt , Ware_einsortieren , Flow_0a9rzst , Flow_Erstattung , Finanzdaten_ermitteln , Flow_Erstattung_Datenermittlung , Erstattung , Flow_Erstattung_abgeschlossen , Flow_normal_auspacken , Ware_auspacken_normal , Flow_0d8lhxo , Flow_spenden , Ware_spenden , Flow_0f171gg ] ; +Flow Flow_8 for process +with elements : [ Retoure_Start , Flow_Start , Gateway_Parallel_Lager_Neusendung , Flow_0eh02jo , Gateway_Beschaedigt , Flow_beschaedigt , Warendaten_erfassen , Flow_01lf19r , Vernichtung_ermitteln , Flow_0kgxxke , Gateway_Vernichtung , Flow_spenden , Ware_spenden , Flow_0f171gg , Gateway_Vernichtung_Close , Flow_14jbtgw , Gateway_Beschaedigt_Close , Flow_1c2tfla , Flow_1gu0k49 , Kundendaten_ermitteln , Flow_0iibopi , Gateway_Neusendung , Flow_Erstattung , Finanzdaten_ermitteln , Flow_Erstattung_Datenermittlung , Erstattung , Flow_Erstattung_abgeschlossen , Gateway_Neusendung_Closed , Flow_0m33odz , Gateway_Parallel_Lager_Neusendung_Closed , Flow_Ende , Retoure_Ende ] +without elements : [ Flow_unbeschaedigt , Ware_einsortieren , Flow_0a9rzst , Flow_neusenden , Manuelle_Pruefung , Flow_0u77zm0 , Warennummer_ermitteln , Flow_03ubi3l , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_paket_okay , Paket_senden , Flow_0u4n4gn , Flow_fehlerhaft_eingepackt , Gateway_Auspacken , Flow_normal_auspacken , Ware_auspacken_normal , Flow_0d8lhxo , Gateway_14evkap , Flow_1bnro90 , Flow_luxus_auspacken , Ware_auspacken_luxus , Flow_04tyvq1 , Flow_vernichten , Ware_vernichten , Flow_0zkq7z5 ] ; +Flow Flow_9 for process +with elements : [ Retoure_Start , Flow_Start , Gateway_Parallel_Lager_Neusendung , Flow_0eh02jo , Gateway_Beschaedigt , Flow_beschaedigt , Warendaten_erfassen , Flow_01lf19r , Vernichtung_ermitteln , Flow_0kgxxke , Gateway_Vernichtung , Flow_spenden , Ware_spenden , Flow_0f171gg , Gateway_Vernichtung_Close , Flow_14jbtgw , Gateway_Beschaedigt_Close , Flow_1c2tfla , Flow_1gu0k49 , Kundendaten_ermitteln , Flow_0iibopi , Gateway_Neusendung , Flow_neusenden , Manuelle_Pruefung , Flow_0u77zm0 , Warennummer_ermitteln , Flow_03ubi3l , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_paket_okay , Paket_senden , Flow_0u4n4gn , Gateway_Neusendung_Closed , Flow_0m33odz , Gateway_Parallel_Lager_Neusendung_Closed , Flow_Ende , Retoure_Ende ] +without elements : [ Flow_unbeschaedigt , Ware_einsortieren , Flow_0a9rzst , Flow_Erstattung , Finanzdaten_ermitteln , Flow_Erstattung_Datenermittlung , Erstattung , Flow_Erstattung_abgeschlossen , Flow_fehlerhaft_eingepackt , Gateway_Auspacken , Flow_normal_auspacken , Ware_auspacken_normal , Flow_0d8lhxo , Gateway_14evkap , Flow_1bnro90 , Flow_luxus_auspacken , Ware_auspacken_luxus , Flow_04tyvq1 , Flow_vernichten , Ware_vernichten , Flow_0zkq7z5 ] ; +Flow Flow_10 for process +with elements : [ Retoure_Start , Flow_Start , Gateway_Parallel_Lager_Neusendung , Flow_0eh02jo , Gateway_Beschaedigt , Flow_beschaedigt , Warendaten_erfassen , Flow_01lf19r , Vernichtung_ermitteln , Flow_0kgxxke , Gateway_Vernichtung , Flow_spenden , Ware_spenden , Flow_0f171gg , Gateway_Vernichtung_Close , Flow_14jbtgw , Gateway_Beschaedigt_Close , Flow_1c2tfla , Flow_1gu0k49 , Kundendaten_ermitteln , Flow_0iibopi , Gateway_Neusendung , Flow_neusenden , Manuelle_Pruefung , Flow_0u77zm0 , Warennummer_ermitteln , Flow_03ubi3l , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_fehlerhaft_eingepackt , Gateway_Auspacken , Flow_normal_auspacken , Ware_auspacken_normal , Flow_0d8lhxo , Gateway_14evkap , Flow_1bnro90 , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_paket_okay , Paket_senden , Flow_0u4n4gn , Gateway_Neusendung_Closed , Flow_0m33odz , Gateway_Parallel_Lager_Neusendung_Closed , Flow_Ende , Retoure_Ende ] +without elements : [ Flow_unbeschaedigt , Ware_einsortieren , Flow_0a9rzst , Flow_Erstattung , Finanzdaten_ermitteln , Flow_Erstattung_Datenermittlung , Erstattung , Flow_Erstattung_abgeschlossen , Flow_luxus_auspacken , Ware_auspacken_luxus , Flow_04tyvq1 , Flow_vernichten , Ware_vernichten , Flow_0zkq7z5 ] ; +Flow Flow_11 for process +with elements : [ Retoure_Start , Flow_Start , Gateway_Parallel_Lager_Neusendung , Flow_0eh02jo , Gateway_Beschaedigt , Flow_beschaedigt , Warendaten_erfassen , Flow_01lf19r , Vernichtung_ermitteln , Flow_0kgxxke , Gateway_Vernichtung , Flow_spenden , Ware_spenden , Flow_0f171gg , Gateway_Vernichtung_Close , Flow_14jbtgw , Gateway_Beschaedigt_Close , Flow_1c2tfla , Flow_1gu0k49 , Kundendaten_ermitteln , Flow_0iibopi , Gateway_Neusendung , Flow_neusenden , Manuelle_Pruefung , Flow_0u77zm0 , Warennummer_ermitteln , Flow_03ubi3l , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_fehlerhaft_eingepackt , Gateway_Auspacken , Flow_luxus_auspacken , Ware_auspacken_luxus , Flow_04tyvq1 , Gateway_14evkap , Flow_1bnro90 , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_paket_okay , Paket_senden , Flow_0u4n4gn , Gateway_Neusendung_Closed , Flow_0m33odz , Gateway_Parallel_Lager_Neusendung_Closed , Flow_Ende , Retoure_Ende ] +without elements : [ Flow_unbeschaedigt , Ware_einsortieren , Flow_0a9rzst , Flow_Erstattung , Finanzdaten_ermitteln , Flow_Erstattung_Datenermittlung , Erstattung , Flow_Erstattung_abgeschlossen , Flow_normal_auspacken , Ware_auspacken_normal , Flow_0d8lhxo , Flow_vernichten , Ware_vernichten , Flow_0zkq7z5 ] ; + +DelegateMock Warennummer_ermitteln for Warennummer_ermitteln with delegate "de.sample.onlineschuhdemo.externalaccess.WarennummerErmittelnDelegate" with manual "de.sample.onlineschuhdemo.externalaccess.LagerService" by setter "setLagerService" ; + +ExternalServiceMock customerProvider for topic customer +with rule : if [ kundennummer == "C-123A456" ] set [ firstname = "Max" , lastname = "Mustermann" ] , +with rule : if [ kundennummer == "C-987A654" ] set [ firstname = "Erika" , lastname = "Mustermann" ] ; + +ExternalServiceMock financialMock for topic financial +with rule : if [ serviceIdentifier == "getData" , kundennummer == "C-123A456" ] set [ ibanRefund = "DE12345678900000123456" ] , +with rule : if [ serviceIdentifier == "getData" , kundennummer == "C-987A654" ] set [ ibanRefund = "DE12345678900000987654" ] , +with rule : if [ serviceIdentifier == "refund" , iban == "DE12345678900000123456" ] set [ confirmationEmailSent = "Nein" ] , +with rule : if [ serviceIdentifier == "refund" ] set [ confirmationEmailSent = "Ja" ] ; + +Test normalverpackungAuspacken for Flow_2 +with variables for Retoure_Start : [ kundennummer = "C-123A456" , erstattung = false , beschaedigt = false ] , +with variables for Paket_packen : [ pakettyp = "Normalverpackung" ] , +with variables for Paket_pruefen : [ paket = false ] , +with variables for Paket_packen : [ pakettyp = "Luxusverpackung" ] , +with variables for Paket_pruefen : [ paket = true ] +with check : [ kundennummer == "C-123A456" , vorname == "Max" , nachname == "Mustermann" , erstattung == false , beschaedigt == false ] +with mocks : [ Warennummer_ermitteln , customerProvider ] ; + +Test vernichtenErstattung for Flow_4 +with variables for Retoure_Start : [ kundennummer = "C-123A456" , erstattung = true , beschaedigt = true ] , +with variables for Warendaten_erfassen : [ marke = "Luxury Foot" , preis = 350 ] +with check : [ kundennummer == "C-123A456" , marke == "Luxury Foot" , iban == "DE12345678900000123456" , vorname == "Max" , nachname == "Mustermann" , emailGesendet == "Nein" , erstattung == true , beschaedigt == true ] +with mocks : [ financialMock , customerProvider ] ; + +Test casetill1 for Flow_0 +with variables for Retoure_Start : [ kundennummer = "123" , erstattung = true , beschaedigt = true ] +with check : [ kundennummer == "123" , marke == "wer" , iban == "DE80123084556" , vorname == "till" , nachname == "Brinkhus" , pakettyp == "Normalverpackung" , emailGesendet == "Ja" , firstname == "Till" , lastname == "Brinkhus" , ibanRefund == "DE80123084556" , confirmationEmailSent == "Ja" , serviceIdentifier == "getData" , preis == 1234 , erstattung == true , paket == true , beschaedigt == false ] +with mocks : [ financialMock , customerProvider ] ; diff --git a/OnlineSchuhDemo/dsl_matching/Testcollection2.bpmn-testgen b/OnlineSchuhDemo/dsl_matching/Testcollection2.bpmn-testgen new file mode 100644 index 0000000000000000000000000000000000000000..34f6ee65cd40e4262215d8bf97c496cbffa9bbbd --- /dev/null +++ b/OnlineSchuhDemo/dsl_matching/Testcollection2.bpmn-testgen @@ -0,0 +1,161 @@ +BPMNDiagram process +with testpackage "de.sample.onlineschuhdemo" with bpmn "retoure.bpmn" with key "Retoure" with dmn : [ "\\schuh_vernichtung_spende.dmn" ] with embedded : [ "\\forms\\warendaten-erfassen-form.html" ] ; + +Loop Loop0 +starts with "Gateway_Einpackung_Fehlerhaft" +follows by "Gateway_Auspacken" +ends with "Gateway_Einpackung_Fehlerhaft_Closed" +has complexity 2 passed : [ 0 , 1 ] ; + +FlowElement Retoure_Start : StartEvent with inputVariables : [ kundennummer , erstattung , beschaedigt ] ; +FlowElement Flow_Start : SequenceFlow ; +FlowElement Gateway_Parallel_Lager_Neusendung : Gateway ; +FlowElement Flow_0eh02jo : SequenceFlow ; +FlowElement Gateway_Beschaedigt : Gateway ; +FlowElement Flow_unbeschaedigt : SequenceFlow ; +FlowElement Ware_einsortieren : ManualTask ; +FlowElement Flow_0a9rzst : SequenceFlow ; +FlowElement Gateway_Beschaedigt_Close : Gateway ; +FlowElement Flow_1c2tfla : SequenceFlow ; +FlowElement Flow_1gu0k49 : SequenceFlow ; +FlowElement Kundendaten_ermitteln : ServiceTask with external : customer ; +FlowElement Flow_0iibopi : SequenceFlow ; +FlowElement Gateway_Neusendung : Gateway ; +FlowElement Flow_Erstattung : SequenceFlow with expression : "#{erstattung}" ; +FlowElement Finanzdaten_ermitteln : ServiceTask with external : financial with hardcoded inputs : [ serviceIdentifier = "getData" ] ; +FlowElement Flow_Erstattung_Datenermittlung : SequenceFlow ; +FlowElement Erstattung : ServiceTask with external : financial with hardcoded inputs : [ serviceIdentifier = "refund" ] ; +FlowElement Flow_Erstattung_abgeschlossen : SequenceFlow ; +FlowElement Gateway_Neusendung_Closed : Gateway ; +FlowElement Flow_0m33odz : SequenceFlow ; +FlowElement Gateway_Parallel_Lager_Neusendung_Closed : Gateway ; +FlowElement Flow_Ende : SequenceFlow ; +FlowElement Retoure_Ende : EndEvent ; +FlowElement Flow_neusenden : SequenceFlow ; +FlowElement Manuelle_Pruefung : UserTask ; +FlowElement Flow_0u77zm0 : SequenceFlow ; +FlowElement Warennummer_ermitteln : ServiceTask with delegate : "warennummer" ; +FlowElement Flow_03ubi3l : SequenceFlow ; +FlowElement Gateway_Einpackung_Fehlerhaft_Closed : Gateway ; +FlowElement Flow_006t3wo : SequenceFlow ; +FlowElement Paket_packen : UserTask with inputVariables : [ pakettyp ] ; +FlowElement Flow_0bhr7g8 : SequenceFlow ; +FlowElement Paket_pruefen : UserTask with inputVariables : [ paket ] ; +FlowElement Flow_1n6o3h6 : SequenceFlow ; +FlowElement Gateway_Einpackung_Fehlerhaft : Gateway ; +FlowElement Flow_paket_okay : SequenceFlow ; +FlowElement Paket_senden : UserTask ; +FlowElement Flow_0u4n4gn : SequenceFlow ; +FlowElement Flow_fehlerhaft_eingepackt : SequenceFlow with expression : "#{paket==false}" ; +FlowElement Gateway_Auspacken : Gateway ; +FlowElement Flow_normal_auspacken : SequenceFlow with expression : "#{pakettyp==\"Normalverpackung\"}" ; +FlowElement Ware_auspacken_normal : ManualTask ; +FlowElement Flow_0d8lhxo : SequenceFlow ; +FlowElement Gateway_14evkap : Gateway ; +FlowElement Flow_1bnro90 : SequenceFlow ; +FlowElement Flow_luxus_auspacken : SequenceFlow with expression : "#{pakettyp==\"Luxusverpackung\"}" ; +FlowElement Ware_auspacken_luxus : ManualTask ; +FlowElement Flow_04tyvq1 : SequenceFlow ; +FlowElement Flow_beschaedigt : SequenceFlow with expression : "#{beschaedigt == true}" ; +FlowElement Warendaten_erfassen : UserTask with inputVariables : [ marke , preis ] ; +FlowElement Flow_01lf19r : SequenceFlow ; +FlowElement Vernichtung_ermitteln : BusinessRuleTask ; +FlowElement Flow_0kgxxke : SequenceFlow ; +FlowElement Gateway_Vernichtung : Gateway ; +FlowElement Flow_vernichten : SequenceFlow with expression : "#{vernichten == true}" ; +FlowElement Ware_vernichten : UserTask ; +FlowElement Flow_0zkq7z5 : SequenceFlow ; +FlowElement Gateway_Vernichtung_Close : Gateway ; +FlowElement Flow_14jbtgw : SequenceFlow ; +FlowElement Flow_spenden : SequenceFlow with expression : "#{vernichten == false}" ; +FlowElement Ware_spenden : UserTask ; +FlowElement Flow_0f171gg : SequenceFlow ; + +String kundennummer with proposals : [ ] ; +String marke with proposals : [ "Luxury Foot" , "Simply Shoe" , "Shoe One" ] ; +String iban with proposals : [ ] ; +String vorname with proposals : [ ] ; +String nachname with proposals : [ ] ; +String pakettyp with proposals : [ "Normalverpackung" , "Luxusverpackung" ] ; +String emailGesendet with proposals : [ ] ; +String firstname with proposals : [ ] ; +String lastname with proposals : [ ] ; +String ibanRefund with proposals : [ ] ; +String confirmationEmailSent with proposals : [ ] ; +String serviceIdentifier with proposals : [ "getData" , "refund" ] ; +Integer preis with proposals : [ 350 , 349 , 70 , 71 ] ; +Boolean erstattung with proposals : [ true , false ] ; +Boolean paket with proposals : [ true , false ] ; +Boolean beschaedigt with proposals : [ true , false ] ; + +ExternalTopic customer ; +ExternalTopic financial ; + +Flow Flow_0 for process +with elements : [ Retoure_Start , Flow_Start , Gateway_Parallel_Lager_Neusendung , Flow_0eh02jo , Gateway_Beschaedigt , Flow_unbeschaedigt , Ware_einsortieren , Flow_0a9rzst , Gateway_Beschaedigt_Close , Flow_1c2tfla , Flow_1gu0k49 , Kundendaten_ermitteln , Flow_0iibopi , Gateway_Neusendung , Flow_Erstattung , Finanzdaten_ermitteln , Flow_Erstattung_Datenermittlung , Erstattung , Flow_Erstattung_abgeschlossen , Gateway_Neusendung_Closed , Flow_0m33odz , Gateway_Parallel_Lager_Neusendung_Closed , Flow_Ende , Retoure_Ende ] +without elements : [ Flow_neusenden , Manuelle_Pruefung , Flow_0u77zm0 , Warennummer_ermitteln , Flow_03ubi3l , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_paket_okay , Paket_senden , Flow_0u4n4gn , Flow_fehlerhaft_eingepackt , Gateway_Auspacken , Flow_normal_auspacken , Ware_auspacken_normal , Flow_0d8lhxo , Gateway_14evkap , Flow_1bnro90 , Flow_luxus_auspacken , Ware_auspacken_luxus , Flow_04tyvq1 , Flow_beschaedigt , Warendaten_erfassen , Flow_01lf19r , Vernichtung_ermitteln , Flow_0kgxxke , Gateway_Vernichtung , Flow_vernichten , Ware_vernichten , Flow_0zkq7z5 , Gateway_Vernichtung_Close , Flow_14jbtgw , Flow_spenden , Ware_spenden , Flow_0f171gg ] ; +Flow Flow_1 for process +with elements : [ Retoure_Start , Flow_Start , Gateway_Parallel_Lager_Neusendung , Flow_0eh02jo , Gateway_Beschaedigt , Flow_unbeschaedigt , Ware_einsortieren , Flow_0a9rzst , Gateway_Beschaedigt_Close , Flow_1c2tfla , Flow_1gu0k49 , Kundendaten_ermitteln , Flow_0iibopi , Gateway_Neusendung , Flow_neusenden , Manuelle_Pruefung , Flow_0u77zm0 , Warennummer_ermitteln , Flow_03ubi3l , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_paket_okay , Paket_senden , Flow_0u4n4gn , Gateway_Neusendung_Closed , Flow_0m33odz , Gateway_Parallel_Lager_Neusendung_Closed , Flow_Ende , Retoure_Ende ] +without elements : [ Flow_Erstattung , Finanzdaten_ermitteln , Flow_Erstattung_Datenermittlung , Erstattung , Flow_Erstattung_abgeschlossen , Flow_fehlerhaft_eingepackt , Gateway_Auspacken , Flow_normal_auspacken , Ware_auspacken_normal , Flow_0d8lhxo , Gateway_14evkap , Flow_1bnro90 , Flow_luxus_auspacken , Ware_auspacken_luxus , Flow_04tyvq1 , Flow_beschaedigt , Warendaten_erfassen , Flow_01lf19r , Vernichtung_ermitteln , Flow_0kgxxke , Gateway_Vernichtung , Flow_vernichten , Ware_vernichten , Flow_0zkq7z5 , Gateway_Vernichtung_Close , Flow_14jbtgw , Flow_spenden , Ware_spenden , Flow_0f171gg ] ; +Flow Flow_2 for process +with elements : [ Retoure_Start , Flow_Start , Gateway_Parallel_Lager_Neusendung , Flow_0eh02jo , Gateway_Beschaedigt , Flow_unbeschaedigt , Ware_einsortieren , Flow_0a9rzst , Gateway_Beschaedigt_Close , Flow_1c2tfla , Flow_1gu0k49 , Kundendaten_ermitteln , Flow_0iibopi , Gateway_Neusendung , Flow_neusenden , Manuelle_Pruefung , Flow_0u77zm0 , Warennummer_ermitteln , Flow_03ubi3l , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_fehlerhaft_eingepackt , Gateway_Auspacken , Flow_normal_auspacken , Ware_auspacken_normal , Flow_0d8lhxo , Gateway_14evkap , Flow_1bnro90 , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_paket_okay , Paket_senden , Flow_0u4n4gn , Gateway_Neusendung_Closed , Flow_0m33odz , Gateway_Parallel_Lager_Neusendung_Closed , Flow_Ende , Retoure_Ende ] +without elements : [ Flow_Erstattung , Finanzdaten_ermitteln , Flow_Erstattung_Datenermittlung , Erstattung , Flow_Erstattung_abgeschlossen , Flow_luxus_auspacken , Ware_auspacken_luxus , Flow_04tyvq1 , Flow_beschaedigt , Warendaten_erfassen , Flow_01lf19r , Vernichtung_ermitteln , Flow_0kgxxke , Gateway_Vernichtung , Flow_vernichten , Ware_vernichten , Flow_0zkq7z5 , Gateway_Vernichtung_Close , Flow_14jbtgw , Flow_spenden , Ware_spenden , Flow_0f171gg ] ; +Flow Flow_3 for process +with elements : [ Retoure_Start , Flow_Start , Gateway_Parallel_Lager_Neusendung , Flow_0eh02jo , Gateway_Beschaedigt , Flow_unbeschaedigt , Ware_einsortieren , Flow_0a9rzst , Gateway_Beschaedigt_Close , Flow_1c2tfla , Flow_1gu0k49 , Kundendaten_ermitteln , Flow_0iibopi , Gateway_Neusendung , Flow_neusenden , Manuelle_Pruefung , Flow_0u77zm0 , Warennummer_ermitteln , Flow_03ubi3l , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_fehlerhaft_eingepackt , Gateway_Auspacken , Flow_luxus_auspacken , Ware_auspacken_luxus , Flow_04tyvq1 , Gateway_14evkap , Flow_1bnro90 , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_paket_okay , Paket_senden , Flow_0u4n4gn , Gateway_Neusendung_Closed , Flow_0m33odz , Gateway_Parallel_Lager_Neusendung_Closed , Flow_Ende , Retoure_Ende ] +without elements : [ Flow_Erstattung , Finanzdaten_ermitteln , Flow_Erstattung_Datenermittlung , Erstattung , Flow_Erstattung_abgeschlossen , Flow_normal_auspacken , Ware_auspacken_normal , Flow_0d8lhxo , Flow_beschaedigt , Warendaten_erfassen , Flow_01lf19r , Vernichtung_ermitteln , Flow_0kgxxke , Gateway_Vernichtung , Flow_vernichten , Ware_vernichten , Flow_0zkq7z5 , Gateway_Vernichtung_Close , Flow_14jbtgw , Flow_spenden , Ware_spenden , Flow_0f171gg ] ; +Flow Flow_4 for process +with elements : [ Retoure_Start , Flow_Start , Gateway_Parallel_Lager_Neusendung , Flow_0eh02jo , Gateway_Beschaedigt , Flow_beschaedigt , Warendaten_erfassen , Flow_01lf19r , Vernichtung_ermitteln , Flow_0kgxxke , Gateway_Vernichtung , Flow_vernichten , Ware_vernichten , Flow_0zkq7z5 , Gateway_Vernichtung_Close , Flow_14jbtgw , Gateway_Beschaedigt_Close , Flow_1c2tfla , Flow_1gu0k49 , Kundendaten_ermitteln , Flow_0iibopi , Gateway_Neusendung , Flow_Erstattung , Finanzdaten_ermitteln , Flow_Erstattung_Datenermittlung , Erstattung , Flow_Erstattung_abgeschlossen , Gateway_Neusendung_Closed , Flow_0m33odz , Gateway_Parallel_Lager_Neusendung_Closed , Flow_Ende , Retoure_Ende ] +without elements : [ Flow_unbeschaedigt , Ware_einsortieren , Flow_0a9rzst , Flow_neusenden , Manuelle_Pruefung , Flow_0u77zm0 , Warennummer_ermitteln , Flow_03ubi3l , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_paket_okay , Paket_senden , Flow_0u4n4gn , Flow_fehlerhaft_eingepackt , Gateway_Auspacken , Flow_normal_auspacken , Ware_auspacken_normal , Flow_0d8lhxo , Gateway_14evkap , Flow_1bnro90 , Flow_luxus_auspacken , Ware_auspacken_luxus , Flow_04tyvq1 , Flow_spenden , Ware_spenden , Flow_0f171gg ] ; +Flow Flow_5 for process +with elements : [ Retoure_Start , Flow_Start , Gateway_Parallel_Lager_Neusendung , Flow_0eh02jo , Gateway_Beschaedigt , Flow_beschaedigt , Warendaten_erfassen , Flow_01lf19r , Vernichtung_ermitteln , Flow_0kgxxke , Gateway_Vernichtung , Flow_vernichten , Ware_vernichten , Flow_0zkq7z5 , Gateway_Vernichtung_Close , Flow_14jbtgw , Gateway_Beschaedigt_Close , Flow_1c2tfla , Flow_1gu0k49 , Kundendaten_ermitteln , Flow_0iibopi , Gateway_Neusendung , Flow_neusenden , Manuelle_Pruefung , Flow_0u77zm0 , Warennummer_ermitteln , Flow_03ubi3l , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_paket_okay , Paket_senden , Flow_0u4n4gn , Gateway_Neusendung_Closed , Flow_0m33odz , Gateway_Parallel_Lager_Neusendung_Closed , Flow_Ende , Retoure_Ende ] +without elements : [ Flow_unbeschaedigt , Ware_einsortieren , Flow_0a9rzst , Flow_Erstattung , Finanzdaten_ermitteln , Flow_Erstattung_Datenermittlung , Erstattung , Flow_Erstattung_abgeschlossen , Flow_fehlerhaft_eingepackt , Gateway_Auspacken , Flow_normal_auspacken , Ware_auspacken_normal , Flow_0d8lhxo , Gateway_14evkap , Flow_1bnro90 , Flow_luxus_auspacken , Ware_auspacken_luxus , Flow_04tyvq1 , Flow_spenden , Ware_spenden , Flow_0f171gg ] ; +Flow Flow_6 for process +with elements : [ Retoure_Start , Flow_Start , Gateway_Parallel_Lager_Neusendung , Flow_0eh02jo , Gateway_Beschaedigt , Flow_beschaedigt , Warendaten_erfassen , Flow_01lf19r , Vernichtung_ermitteln , Flow_0kgxxke , Gateway_Vernichtung , Flow_vernichten , Ware_vernichten , Flow_0zkq7z5 , Gateway_Vernichtung_Close , Flow_14jbtgw , Gateway_Beschaedigt_Close , Flow_1c2tfla , Flow_1gu0k49 , Kundendaten_ermitteln , Flow_0iibopi , Gateway_Neusendung , Flow_neusenden , Manuelle_Pruefung , Flow_0u77zm0 , Warennummer_ermitteln , Flow_03ubi3l , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_fehlerhaft_eingepackt , Gateway_Auspacken , Flow_normal_auspacken , Ware_auspacken_normal , Flow_0d8lhxo , Gateway_14evkap , Flow_1bnro90 , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_paket_okay , Paket_senden , Flow_0u4n4gn , Gateway_Neusendung_Closed , Flow_0m33odz , Gateway_Parallel_Lager_Neusendung_Closed , Flow_Ende , Retoure_Ende ] +without elements : [ Flow_unbeschaedigt , Ware_einsortieren , Flow_0a9rzst , Flow_Erstattung , Finanzdaten_ermitteln , Flow_Erstattung_Datenermittlung , Erstattung , Flow_Erstattung_abgeschlossen , Flow_luxus_auspacken , Ware_auspacken_luxus , Flow_04tyvq1 , Flow_spenden , Ware_spenden , Flow_0f171gg ] ; +Flow Flow_7 for process +with elements : [ Retoure_Start , Flow_Start , Gateway_Parallel_Lager_Neusendung , Flow_0eh02jo , Gateway_Beschaedigt , Flow_beschaedigt , Warendaten_erfassen , Flow_01lf19r , Vernichtung_ermitteln , Flow_0kgxxke , Gateway_Vernichtung , Flow_vernichten , Ware_vernichten , Flow_0zkq7z5 , Gateway_Vernichtung_Close , Flow_14jbtgw , Gateway_Beschaedigt_Close , Flow_1c2tfla , Flow_1gu0k49 , Kundendaten_ermitteln , Flow_0iibopi , Gateway_Neusendung , Flow_neusenden , Manuelle_Pruefung , Flow_0u77zm0 , Warennummer_ermitteln , Flow_03ubi3l , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_fehlerhaft_eingepackt , Gateway_Auspacken , Flow_luxus_auspacken , Ware_auspacken_luxus , Flow_04tyvq1 , Gateway_14evkap , Flow_1bnro90 , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_paket_okay , Paket_senden , Flow_0u4n4gn , Gateway_Neusendung_Closed , Flow_0m33odz , Gateway_Parallel_Lager_Neusendung_Closed , Flow_Ende , Retoure_Ende ] +without elements : [ Flow_unbeschaedigt , Ware_einsortieren , Flow_0a9rzst , Flow_Erstattung , Finanzdaten_ermitteln , Flow_Erstattung_Datenermittlung , Erstattung , Flow_Erstattung_abgeschlossen , Flow_normal_auspacken , Ware_auspacken_normal , Flow_0d8lhxo , Flow_spenden , Ware_spenden , Flow_0f171gg ] ; +Flow Flow_8 for process +with elements : [ Retoure_Start , Flow_Start , Gateway_Parallel_Lager_Neusendung , Flow_0eh02jo , Gateway_Beschaedigt , Flow_beschaedigt , Warendaten_erfassen , Flow_01lf19r , Vernichtung_ermitteln , Flow_0kgxxke , Gateway_Vernichtung , Flow_spenden , Ware_spenden , Flow_0f171gg , Gateway_Vernichtung_Close , Flow_14jbtgw , Gateway_Beschaedigt_Close , Flow_1c2tfla , Flow_1gu0k49 , Kundendaten_ermitteln , Flow_0iibopi , Gateway_Neusendung , Flow_Erstattung , Finanzdaten_ermitteln , Flow_Erstattung_Datenermittlung , Erstattung , Flow_Erstattung_abgeschlossen , Gateway_Neusendung_Closed , Flow_0m33odz , Gateway_Parallel_Lager_Neusendung_Closed , Flow_Ende , Retoure_Ende ] +without elements : [ Flow_unbeschaedigt , Ware_einsortieren , Flow_0a9rzst , Flow_neusenden , Manuelle_Pruefung , Flow_0u77zm0 , Warennummer_ermitteln , Flow_03ubi3l , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_paket_okay , Paket_senden , Flow_0u4n4gn , Flow_fehlerhaft_eingepackt , Gateway_Auspacken , Flow_normal_auspacken , Ware_auspacken_normal , Flow_0d8lhxo , Gateway_14evkap , Flow_1bnro90 , Flow_luxus_auspacken , Ware_auspacken_luxus , Flow_04tyvq1 , Flow_vernichten , Ware_vernichten , Flow_0zkq7z5 ] ; +Flow Flow_9 for process +with elements : [ Retoure_Start , Flow_Start , Gateway_Parallel_Lager_Neusendung , Flow_0eh02jo , Gateway_Beschaedigt , Flow_beschaedigt , Warendaten_erfassen , Flow_01lf19r , Vernichtung_ermitteln , Flow_0kgxxke , Gateway_Vernichtung , Flow_spenden , Ware_spenden , Flow_0f171gg , Gateway_Vernichtung_Close , Flow_14jbtgw , Gateway_Beschaedigt_Close , Flow_1c2tfla , Flow_1gu0k49 , Kundendaten_ermitteln , Flow_0iibopi , Gateway_Neusendung , Flow_neusenden , Manuelle_Pruefung , Flow_0u77zm0 , Warennummer_ermitteln , Flow_03ubi3l , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_paket_okay , Paket_senden , Flow_0u4n4gn , Gateway_Neusendung_Closed , Flow_0m33odz , Gateway_Parallel_Lager_Neusendung_Closed , Flow_Ende , Retoure_Ende ] +without elements : [ Flow_unbeschaedigt , Ware_einsortieren , Flow_0a9rzst , Flow_Erstattung , Finanzdaten_ermitteln , Flow_Erstattung_Datenermittlung , Erstattung , Flow_Erstattung_abgeschlossen , Flow_fehlerhaft_eingepackt , Gateway_Auspacken , Flow_normal_auspacken , Ware_auspacken_normal , Flow_0d8lhxo , Gateway_14evkap , Flow_1bnro90 , Flow_luxus_auspacken , Ware_auspacken_luxus , Flow_04tyvq1 , Flow_vernichten , Ware_vernichten , Flow_0zkq7z5 ] ; +Flow Flow_10 for process +with elements : [ Retoure_Start , Flow_Start , Gateway_Parallel_Lager_Neusendung , Flow_0eh02jo , Gateway_Beschaedigt , Flow_beschaedigt , Warendaten_erfassen , Flow_01lf19r , Vernichtung_ermitteln , Flow_0kgxxke , Gateway_Vernichtung , Flow_spenden , Ware_spenden , Flow_0f171gg , Gateway_Vernichtung_Close , Flow_14jbtgw , Gateway_Beschaedigt_Close , Flow_1c2tfla , Flow_1gu0k49 , Kundendaten_ermitteln , Flow_0iibopi , Gateway_Neusendung , Flow_neusenden , Manuelle_Pruefung , Flow_0u77zm0 , Warennummer_ermitteln , Flow_03ubi3l , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_fehlerhaft_eingepackt , Gateway_Auspacken , Flow_normal_auspacken , Ware_auspacken_normal , Flow_0d8lhxo , Gateway_14evkap , Flow_1bnro90 , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_paket_okay , Paket_senden , Flow_0u4n4gn , Gateway_Neusendung_Closed , Flow_0m33odz , Gateway_Parallel_Lager_Neusendung_Closed , Flow_Ende , Retoure_Ende ] +without elements : [ Flow_unbeschaedigt , Ware_einsortieren , Flow_0a9rzst , Flow_Erstattung , Finanzdaten_ermitteln , Flow_Erstattung_Datenermittlung , Erstattung , Flow_Erstattung_abgeschlossen , Flow_luxus_auspacken , Ware_auspacken_luxus , Flow_04tyvq1 , Flow_vernichten , Ware_vernichten , Flow_0zkq7z5 ] ; +Flow Flow_11 for process +with elements : [ Retoure_Start , Flow_Start , Gateway_Parallel_Lager_Neusendung , Flow_0eh02jo , Gateway_Beschaedigt , Flow_beschaedigt , Warendaten_erfassen , Flow_01lf19r , Vernichtung_ermitteln , Flow_0kgxxke , Gateway_Vernichtung , Flow_spenden , Ware_spenden , Flow_0f171gg , Gateway_Vernichtung_Close , Flow_14jbtgw , Gateway_Beschaedigt_Close , Flow_1c2tfla , Flow_1gu0k49 , Kundendaten_ermitteln , Flow_0iibopi , Gateway_Neusendung , Flow_neusenden , Manuelle_Pruefung , Flow_0u77zm0 , Warennummer_ermitteln , Flow_03ubi3l , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_fehlerhaft_eingepackt , Gateway_Auspacken , Flow_luxus_auspacken , Ware_auspacken_luxus , Flow_04tyvq1 , Gateway_14evkap , Flow_1bnro90 , Gateway_Einpackung_Fehlerhaft_Closed , Flow_006t3wo , Paket_packen , Flow_0bhr7g8 , Paket_pruefen , Flow_1n6o3h6 , Gateway_Einpackung_Fehlerhaft , Flow_paket_okay , Paket_senden , Flow_0u4n4gn , Gateway_Neusendung_Closed , Flow_0m33odz , Gateway_Parallel_Lager_Neusendung_Closed , Flow_Ende , Retoure_Ende ] +without elements : [ Flow_unbeschaedigt , Ware_einsortieren , Flow_0a9rzst , Flow_Erstattung , Finanzdaten_ermitteln , Flow_Erstattung_Datenermittlung , Erstattung , Flow_Erstattung_abgeschlossen , Flow_normal_auspacken , Ware_auspacken_normal , Flow_0d8lhxo , Flow_vernichten , Ware_vernichten , Flow_0zkq7z5 ] ; + +DelegateMock Warennummer_ermitteln for Warennummer_ermitteln with delegate "de.sample.onlineschuhdemo.externalaccess.WarennummerErmittelnDelegate" with manual "de.sample.onlineschuhdemo.externalaccess.LagerService" by setter "setLagerService" ; + +ExternalServiceMock customerProvider for topic customer +with rule : if [ kundennummer == "C-123A456" ] set [ firstname = "Max" , lastname = "Mustermann" ] , +with rule : if [ kundennummer == "C-987A654" ] set [ firstname = "Erika" , lastname = "Mustermann" ] ; + +ExternalServiceMock financialMock for topic financial +with rule : if [ serviceIdentifier == "getData" , kundennummer == "C-123A456" ] set [ ibanRefund = "DE12345678900000123456" ] , +with rule : if [ serviceIdentifier == "getData" , kundennummer == "C-987A654" ] set [ ibanRefund = "DE12345678900000987654" ] , +with rule : if [ serviceIdentifier == "refund" , iban == "DE12345678900000123456" ] set [ confirmationEmailSent = "Nein" ] , +with rule : if [ serviceIdentifier == "refund" ] set [ confirmationEmailSent = "Ja" ] ; + +Test normalverpackungAuspacken for Flow_2 +with variables for Retoure_Start : [ kundennummer = "C-123A456" , erstattung = false , beschaedigt = false ] , +with variables for Paket_packen : [ pakettyp = "Normalverpackung" ] , +with variables for Paket_pruefen : [ paket = false ] , +with variables for Paket_packen : [ pakettyp = "Luxusverpackung" ] , +with variables for Paket_pruefen : [ paket = true ] +with check : [ kundennummer == "C-123A456" , vorname == "Max" , nachname == "Mustermann" , erstattung == false , beschaedigt == false ] +with mocks : [ Warennummer_ermitteln , customerProvider ] ; + +Test vernichtenErstattung for Flow_4 +with variables for Retoure_Start : [ kundennummer = "C-123A456" , erstattung = true , beschaedigt = true ] , +with variables for Warendaten_erfassen : [ marke = "Luxury Foot" , preis = 350 ] +with check : [ kundennummer == "C-123A456" , marke == "Luxury Foot" , iban == "DE12345678900000123456" , vorname == "Max" , nachname == "Mustermann" , emailGesendet == "Nein" , erstattung == true , beschaedigt == true ] +with mocks : [ financialMock , customerProvider ] ; + +Test casetill1 for Flow_0 +with variables for Retoure_Start : [ kundennummer = "123" , erstattung = true , beschaedigt = true ] +with check : [ kundennummer == "123" , marke == "wer" , iban == "DE80123084556" , vorname == "till" , nachname == "Brinkhus" , pakettyp == "Normalverpackung" , emailGesendet == "Ja" , firstname == "Till" , lastname == "Brinkhus" , ibanRefund == "DE80123084556" , confirmationEmailSent == "Ja" , serviceIdentifier == "getData" , preis == 1234 , erstattung == true , paket == true , beschaedigt == false ] +with mocks : [ financialMock , customerProvider ] ; diff --git a/OnlineSchuhDemo/src-gen/de/sample/onlineschuhdemo/Testcollection.java b/OnlineSchuhDemo/src-gen/de/sample/onlineschuhdemo/Testcollection.java index e2f5326f509ec28365a7d6d5a716f95c11a403de..1407139f5219546c9663eab3b8be16d2cd420309 100644 --- a/OnlineSchuhDemo/src-gen/de/sample/onlineschuhdemo/Testcollection.java +++ b/OnlineSchuhDemo/src-gen/de/sample/onlineschuhdemo/Testcollection.java @@ -604,4 +604,316 @@ public class Testcollection { .contains(entry(VAR_KUNDENNUMMER, "C-123A456"), entry(VAR_EMAILGESENDET, "Nein"), entry(VAR_MARKE, "Luxury Foot"), entry(VAR_IBAN, "DE12345678900000123456"), entry(VAR_VORNAME, "Max"), entry(VAR_ERSTATTUNG, true), entry(VAR_NACHNAME, "Mustermann"), entry(VAR_BESCHAEDIGT, true)); // } + + @Test + @Deployment(resources = {"retoure.bpmn", "\\schuh_vernichtung_spende.dmn"}) + public void casetill1() { + + ProcessInstance processInstance = runtimeService() // + .startProcessInstanceByKey("Retoure", withVariables(VAR_BESCHAEDIGT, true, VAR_ERSTATTUNG, true, VAR_KUNDENNUMMER, "123")); // + + assertThat(processInstance) // + .isStarted() // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasNotPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + Map<String, Object> variableSnapshot0 = runtimeService() // + .getVariables(processInstance.getId()); // + List<LockedExternalTask> lockedTasks0 = lockTasks("customer"); + complete(getLockedTask(lockedTasks0, ServiceTasks.KUNDENDATEN_ERMITTELN), ExternalServiceMockProvider.customerProvider(variableSnapshot0)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + Map<String, Object> variableSnapshot1 = runtimeService() // + .getVariables(processInstance.getId()); // + variableSnapshot1.put(VAR_SERVICEIDENTIFIER, "getData"); + List<LockedExternalTask> lockedTasks1 = lockTasks(lockedTasks0, "financial"); + complete(getLockedTask(lockedTasks1, ServiceTasks.FINANZDATEN_ERMITTELN), ExternalServiceMockProvider.financialMock(variableSnapshot1)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + Map<String, Object> variableSnapshot2 = runtimeService() // + .getVariables(processInstance.getId()); // + variableSnapshot2.put(VAR_SERVICEIDENTIFIER, "refund"); + List<LockedExternalTask> lockedTasks2 = lockTasks(lockedTasks1, "financial"); + complete(getLockedTask(lockedTasks2, ServiceTasks.ERSTATTUNG), ExternalServiceMockProvider.financialMock(variableSnapshot2)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasPassed(ServiceTasks.ERSTATTUNG) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasPassed(Events.RETOURE_ENDE) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isEnded() // + .variables() // + .contains(entry(VAR_IBANREFUND, "DE80123084556"), entry(VAR_FIRSTNAME, "Till"), entry(VAR_VORNAME, "till"), entry(VAR_LASTNAME, "Brinkhus"), entry(VAR_SERVICEIDENTIFIER, "getData"), entry(VAR_BESCHAEDIGT, false), entry(VAR_KUNDENNUMMER, "123"), entry(VAR_EMAILGESENDET, "Ja"), entry(VAR_PREIS, 1234), entry(VAR_MARKE, "wer"), entry(VAR_IBAN, "DE80123084556"), entry(VAR_ERSTATTUNG, true), entry(VAR_CONFIRMATIONEMAILSENT, "Ja"), entry(VAR_NACHNAME, "Brinkhus"), entry(VAR_PAKETTYP, "Normalverpackung"), entry(VAR_PAKET, true)); // + + } + + @Test + @Deployment(resources = {"retoure.bpmn", "\\schuh_vernichtung_spende.dmn"}) + public void casetill2() { + + ProcessInstance processInstance = runtimeService() // + .startProcessInstanceByKey("Retoure", withVariables(VAR_BESCHAEDIGT, true, VAR_ERSTATTUNG, true, VAR_KUNDENNUMMER, "12345")); // + + assertThat(processInstance) // + .isStarted() // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasNotPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + Map<String, Object> variableSnapshot0 = runtimeService() // + .getVariables(processInstance.getId()); // + List<LockedExternalTask> lockedTasks0 = lockTasks("customer"); + complete(getLockedTask(lockedTasks0, ServiceTasks.KUNDENDATEN_ERMITTELN), ExternalServiceMockProvider.customerProvider(variableSnapshot0)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + Map<String, Object> variableSnapshot1 = runtimeService() // + .getVariables(processInstance.getId()); // + variableSnapshot1.put(VAR_SERVICEIDENTIFIER, "getData"); + List<LockedExternalTask> lockedTasks1 = lockTasks(lockedTasks0, "financial"); + complete(getLockedTask(lockedTasks1, ServiceTasks.FINANZDATEN_ERMITTELN), ExternalServiceMockProvider.financialMock(variableSnapshot1)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + Map<String, Object> variableSnapshot2 = runtimeService() // + .getVariables(processInstance.getId()); // + variableSnapshot2.put(VAR_SERVICEIDENTIFIER, "refund"); + List<LockedExternalTask> lockedTasks2 = lockTasks(lockedTasks1, "financial"); + complete(getLockedTask(lockedTasks2, ServiceTasks.ERSTATTUNG), ExternalServiceMockProvider.financialMock(variableSnapshot2)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasPassed(ServiceTasks.ERSTATTUNG) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasPassed(Events.RETOURE_ENDE) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isEnded(); // + + } } diff --git a/OnlineSchuhDemo/src-gen/de/sample/onlineschuhdemo/Testcollection1.java b/OnlineSchuhDemo/src-gen/de/sample/onlineschuhdemo/Testcollection1.java new file mode 100644 index 0000000000000000000000000000000000000000..b16f0454e579b7cf00945218c230895fba07f06e --- /dev/null +++ b/OnlineSchuhDemo/src-gen/de/sample/onlineschuhdemo/Testcollection1.java @@ -0,0 +1,764 @@ +package de.sample.onlineschuhdemo; + +import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.complete; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.runtimeService; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.task; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.withVariables; +import static org.assertj.core.api.Assertions.entry; +import static de.sample.onlineschuhdemo.TestUtils.*; + +import org.apache.ibatis.logging.LogFactory; +import org.camunda.bpm.engine.runtime.ProcessInstance; +import org.camunda.bpm.engine.test.Deployment; +import org.camunda.bpm.engine.test.ProcessEngineRule; +import org.camunda.bpm.engine.externaltask.LockedExternalTask; +import org.camunda.bpm.engine.test.mock.Mocks; +import de.sample.onlineschuhdemo.externalaccess.LagerService; +import de.sample.onlineschuhdemo.externalaccess.WarennummerErmittelnDelegate; +import org.camunda.bpm.extension.process_test_coverage.junit.rules.TestCoverageProcessEngineRuleBuilder; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import java.util.List; +import java.util.Map; + +public class Testcollection1 { + + @ClassRule + @Rule + public static ProcessEngineRule rule = TestCoverageProcessEngineRuleBuilder.create().build(); + + private static final String VAR_KUNDENNUMMER = "kundennummer"; + private static final String VAR_MARKE = "marke"; + private static final String VAR_IBAN = "iban"; + private static final String VAR_VORNAME = "vorname"; + private static final String VAR_NACHNAME = "nachname"; + private static final String VAR_PAKETTYP = "pakettyp"; + private static final String VAR_EMAILGESENDET = "emailGesendet"; + private static final String VAR_FIRSTNAME = "firstname"; + private static final String VAR_LASTNAME = "lastname"; + private static final String VAR_IBANREFUND = "ibanRefund"; + private static final String VAR_CONFIRMATIONEMAILSENT = "confirmationEmailSent"; + private static final String VAR_SERVICEIDENTIFIER = "serviceIdentifier"; + private static final String VAR_PREIS = "preis"; + private static final String VAR_ERSTATTUNG = "erstattung"; + private static final String VAR_PAKET = "paket"; + private static final String VAR_BESCHAEDIGT = "beschaedigt"; + + static { + LogFactory.useSlf4jLogging(); + } + + @Before + public void setup() { + init(rule.getProcessEngine()); + + LagerService lagerService = new LagerService(); + + WarennummerErmittelnDelegate warennummerErmittelnDelegate = new WarennummerErmittelnDelegate(); + warennummerErmittelnDelegate.setLagerService(lagerService); + + Mocks.register("warennummer", warennummerErmittelnDelegate); + } + + @Test + @Deployment(resources = {"retoure.bpmn", "\\schuh_vernichtung_spende.dmn"}) + public void normalverpackungAuspacken() { + + ProcessInstance processInstance = runtimeService() // + .startProcessInstanceByKey("Retoure", withVariables(VAR_BESCHAEDIGT, false, VAR_ERSTATTUNG, false, VAR_KUNDENNUMMER, "C-123A456")); // + + assertThat(processInstance) // + .isStarted() // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasNotPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + Map<String, Object> variableSnapshot0 = runtimeService() // + .getVariables(processInstance.getId()); // + List<LockedExternalTask> lockedTasks0 = lockTasks("customer"); + complete(getLockedTask(lockedTasks0, ServiceTasks.KUNDENDATEN_ERMITTELN), ExternalServiceMockProvider.customerProvider(variableSnapshot0)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + complete(task(UserTasks.MANUELLE_PRUEFUNG)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + complete(task(UserTasks.PAKET_PACKEN), withVariables(VAR_PAKETTYP, "Normalverpackung")); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + complete(task(UserTasks.PAKET_PRUEFEN), withVariables(VAR_PAKET, false)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasPassed(UserTasks.PAKET_PACKEN) // + .hasPassed(UserTasks.PAKET_PRUEFEN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasPassed(Gateways.GATEWAY_14EVKAP) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasPassed(UserTasks.PAKET_PACKEN) // + .hasPassed(UserTasks.PAKET_PRUEFEN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + complete(task(UserTasks.PAKET_PACKEN), withVariables(VAR_PAKETTYP, "Luxusverpackung")); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasPassed(UserTasks.PAKET_PACKEN) // + .hasPassed(UserTasks.PAKET_PRUEFEN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasPassed(Gateways.GATEWAY_14EVKAP) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasPassed(UserTasks.PAKET_PACKEN) // + .hasPassed(UserTasks.PAKET_PRUEFEN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + complete(task(UserTasks.PAKET_PRUEFEN), withVariables(VAR_PAKET, true)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasPassed(UserTasks.PAKET_PACKEN) // + .hasPassed(UserTasks.PAKET_PRUEFEN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasPassed(Gateways.GATEWAY_14EVKAP) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasPassed(UserTasks.PAKET_PACKEN) // + .hasPassed(UserTasks.PAKET_PRUEFEN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + complete(task(UserTasks.PAKET_SENDEN)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasPassed(UserTasks.PAKET_PACKEN) // + .hasPassed(UserTasks.PAKET_PRUEFEN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasPassed(Gateways.GATEWAY_14EVKAP) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasPassed(UserTasks.PAKET_PACKEN) // + .hasPassed(UserTasks.PAKET_PRUEFEN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasPassed(UserTasks.PAKET_SENDEN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isEnded() // + .variables() // + .contains(entry(VAR_KUNDENNUMMER, "C-123A456"), entry(VAR_VORNAME, "Max"), entry(VAR_ERSTATTUNG, false), entry(VAR_NACHNAME, "Mustermann"), entry(VAR_BESCHAEDIGT, false)); // + + } + + @Test + @Deployment(resources = {"retoure.bpmn", "\\schuh_vernichtung_spende.dmn"}) + public void vernichtenErstattung() { + + ProcessInstance processInstance = runtimeService() // + .startProcessInstanceByKey("Retoure", withVariables(VAR_BESCHAEDIGT, true, VAR_ERSTATTUNG, true, VAR_KUNDENNUMMER, "C-123A456")); // + + assertThat(processInstance) // + .isStarted() // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasNotPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + complete(task(UserTasks.WARENDATEN_ERFASSEN), withVariables(VAR_MARKE, "Luxury Foot", VAR_PREIS, 350)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasNotPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + complete(task(UserTasks.WARE_VERNICHTEN)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasPassed(UserTasks.WARE_VERNICHTEN) // + .hasPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasNotPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + Map<String, Object> variableSnapshot0 = runtimeService() // + .getVariables(processInstance.getId()); // + List<LockedExternalTask> lockedTasks0 = lockTasks("customer"); + complete(getLockedTask(lockedTasks0, ServiceTasks.KUNDENDATEN_ERMITTELN), ExternalServiceMockProvider.customerProvider(variableSnapshot0)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasPassed(UserTasks.WARE_VERNICHTEN) // + .hasPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + Map<String, Object> variableSnapshot1 = runtimeService() // + .getVariables(processInstance.getId()); // + variableSnapshot1.put(VAR_SERVICEIDENTIFIER, "getData"); + List<LockedExternalTask> lockedTasks1 = lockTasks(lockedTasks0, "financial"); + complete(getLockedTask(lockedTasks1, ServiceTasks.FINANZDATEN_ERMITTELN), ExternalServiceMockProvider.financialMock(variableSnapshot1)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasPassed(UserTasks.WARE_VERNICHTEN) // + .hasPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + Map<String, Object> variableSnapshot2 = runtimeService() // + .getVariables(processInstance.getId()); // + variableSnapshot2.put(VAR_SERVICEIDENTIFIER, "refund"); + List<LockedExternalTask> lockedTasks2 = lockTasks(lockedTasks1, "financial"); + complete(getLockedTask(lockedTasks2, ServiceTasks.ERSTATTUNG), ExternalServiceMockProvider.financialMock(variableSnapshot2)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasPassed(UserTasks.WARE_VERNICHTEN) // + .hasPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasPassed(ServiceTasks.ERSTATTUNG) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isEnded() // + .variables() // + .contains(entry(VAR_KUNDENNUMMER, "C-123A456"), entry(VAR_EMAILGESENDET, "Nein"), entry(VAR_MARKE, "Luxury Foot"), entry(VAR_IBAN, "DE12345678900000123456"), entry(VAR_VORNAME, "Max"), entry(VAR_ERSTATTUNG, true), entry(VAR_NACHNAME, "Mustermann"), entry(VAR_BESCHAEDIGT, true)); // + + } + + @Test + @Deployment(resources = {"retoure.bpmn", "\\schuh_vernichtung_spende.dmn"}) + public void casetill1() { + + ProcessInstance processInstance = runtimeService() // + .startProcessInstanceByKey("Retoure", withVariables(VAR_BESCHAEDIGT, true, VAR_ERSTATTUNG, true, VAR_KUNDENNUMMER, "123")); // + + assertThat(processInstance) // + .isStarted() // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasNotPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + Map<String, Object> variableSnapshot0 = runtimeService() // + .getVariables(processInstance.getId()); // + List<LockedExternalTask> lockedTasks0 = lockTasks("customer"); + complete(getLockedTask(lockedTasks0, ServiceTasks.KUNDENDATEN_ERMITTELN), ExternalServiceMockProvider.customerProvider(variableSnapshot0)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + Map<String, Object> variableSnapshot1 = runtimeService() // + .getVariables(processInstance.getId()); // + variableSnapshot1.put(VAR_SERVICEIDENTIFIER, "getData"); + List<LockedExternalTask> lockedTasks1 = lockTasks(lockedTasks0, "financial"); + complete(getLockedTask(lockedTasks1, ServiceTasks.FINANZDATEN_ERMITTELN), ExternalServiceMockProvider.financialMock(variableSnapshot1)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + Map<String, Object> variableSnapshot2 = runtimeService() // + .getVariables(processInstance.getId()); // + variableSnapshot2.put(VAR_SERVICEIDENTIFIER, "refund"); + List<LockedExternalTask> lockedTasks2 = lockTasks(lockedTasks1, "financial"); + complete(getLockedTask(lockedTasks2, ServiceTasks.ERSTATTUNG), ExternalServiceMockProvider.financialMock(variableSnapshot2)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasPassed(ServiceTasks.ERSTATTUNG) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasPassed(Events.RETOURE_ENDE) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isEnded() // + .variables() // + .contains(entry(VAR_IBANREFUND, "DE80123084556"), entry(VAR_FIRSTNAME, "Till"), entry(VAR_VORNAME, "till"), entry(VAR_LASTNAME, "Brinkhus"), entry(VAR_SERVICEIDENTIFIER, "getData"), entry(VAR_BESCHAEDIGT, false), entry(VAR_KUNDENNUMMER, "123"), entry(VAR_EMAILGESENDET, "Ja"), entry(VAR_PREIS, 1234), entry(VAR_MARKE, "wer"), entry(VAR_IBAN, "DE80123084556"), entry(VAR_ERSTATTUNG, true), entry(VAR_CONFIRMATIONEMAILSENT, "Ja"), entry(VAR_NACHNAME, "Brinkhus"), entry(VAR_PAKETTYP, "Normalverpackung"), entry(VAR_PAKET, true)); // + + } +} diff --git a/OnlineSchuhDemo/src-gen/de/sample/onlineschuhdemo/Testcollection2.java b/OnlineSchuhDemo/src-gen/de/sample/onlineschuhdemo/Testcollection2.java new file mode 100644 index 0000000000000000000000000000000000000000..3205ea1669814bdc3dea3d3813aff15bb9beb0f1 --- /dev/null +++ b/OnlineSchuhDemo/src-gen/de/sample/onlineschuhdemo/Testcollection2.java @@ -0,0 +1,764 @@ +package de.sample.onlineschuhdemo; + +import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.complete; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.runtimeService; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.task; +import static org.camunda.bpm.engine.test.assertions.bpmn.BpmnAwareTests.withVariables; +import static org.assertj.core.api.Assertions.entry; +import static de.sample.onlineschuhdemo.TestUtils.*; + +import org.apache.ibatis.logging.LogFactory; +import org.camunda.bpm.engine.runtime.ProcessInstance; +import org.camunda.bpm.engine.test.Deployment; +import org.camunda.bpm.engine.test.ProcessEngineRule; +import org.camunda.bpm.engine.externaltask.LockedExternalTask; +import org.camunda.bpm.engine.test.mock.Mocks; +import de.sample.onlineschuhdemo.externalaccess.LagerService; +import de.sample.onlineschuhdemo.externalaccess.WarennummerErmittelnDelegate; +import org.camunda.bpm.extension.process_test_coverage.junit.rules.TestCoverageProcessEngineRuleBuilder; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import java.util.List; +import java.util.Map; + +public class Testcollection2 { + + @ClassRule + @Rule + public static ProcessEngineRule rule = TestCoverageProcessEngineRuleBuilder.create().build(); + + private static final String VAR_KUNDENNUMMER = "kundennummer"; + private static final String VAR_MARKE = "marke"; + private static final String VAR_IBAN = "iban"; + private static final String VAR_VORNAME = "vorname"; + private static final String VAR_NACHNAME = "nachname"; + private static final String VAR_PAKETTYP = "pakettyp"; + private static final String VAR_EMAILGESENDET = "emailGesendet"; + private static final String VAR_FIRSTNAME = "firstname"; + private static final String VAR_LASTNAME = "lastname"; + private static final String VAR_IBANREFUND = "ibanRefund"; + private static final String VAR_CONFIRMATIONEMAILSENT = "confirmationEmailSent"; + private static final String VAR_SERVICEIDENTIFIER = "serviceIdentifier"; + private static final String VAR_PREIS = "preis"; + private static final String VAR_ERSTATTUNG = "erstattung"; + private static final String VAR_PAKET = "paket"; + private static final String VAR_BESCHAEDIGT = "beschaedigt"; + + static { + LogFactory.useSlf4jLogging(); + } + + @Before + public void setup() { + init(rule.getProcessEngine()); + + LagerService lagerService = new LagerService(); + + WarennummerErmittelnDelegate warennummerErmittelnDelegate = new WarennummerErmittelnDelegate(); + warennummerErmittelnDelegate.setLagerService(lagerService); + + Mocks.register("warennummer", warennummerErmittelnDelegate); + } + + @Test + @Deployment(resources = {"retoure.bpmn", "\\schuh_vernichtung_spende.dmn"}) + public void normalverpackungAuspacken() { + + ProcessInstance processInstance = runtimeService() // + .startProcessInstanceByKey("Retoure", withVariables(VAR_BESCHAEDIGT, false, VAR_ERSTATTUNG, false, VAR_KUNDENNUMMER, "C-123A456")); // + + assertThat(processInstance) // + .isStarted() // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasNotPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + Map<String, Object> variableSnapshot0 = runtimeService() // + .getVariables(processInstance.getId()); // + List<LockedExternalTask> lockedTasks0 = lockTasks("customer"); + complete(getLockedTask(lockedTasks0, ServiceTasks.KUNDENDATEN_ERMITTELN), ExternalServiceMockProvider.customerProvider(variableSnapshot0)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + complete(task(UserTasks.MANUELLE_PRUEFUNG)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + complete(task(UserTasks.PAKET_PACKEN), withVariables(VAR_PAKETTYP, "Normalverpackung")); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + complete(task(UserTasks.PAKET_PRUEFEN), withVariables(VAR_PAKET, false)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasPassed(UserTasks.PAKET_PACKEN) // + .hasPassed(UserTasks.PAKET_PRUEFEN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasPassed(Gateways.GATEWAY_14EVKAP) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasPassed(UserTasks.PAKET_PACKEN) // + .hasPassed(UserTasks.PAKET_PRUEFEN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + complete(task(UserTasks.PAKET_PACKEN), withVariables(VAR_PAKETTYP, "Luxusverpackung")); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasPassed(UserTasks.PAKET_PACKEN) // + .hasPassed(UserTasks.PAKET_PRUEFEN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasPassed(Gateways.GATEWAY_14EVKAP) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasPassed(UserTasks.PAKET_PACKEN) // + .hasPassed(UserTasks.PAKET_PRUEFEN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + complete(task(UserTasks.PAKET_PRUEFEN), withVariables(VAR_PAKET, true)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasPassed(UserTasks.PAKET_PACKEN) // + .hasPassed(UserTasks.PAKET_PRUEFEN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasPassed(Gateways.GATEWAY_14EVKAP) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasPassed(UserTasks.PAKET_PACKEN) // + .hasPassed(UserTasks.PAKET_PRUEFEN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + complete(task(UserTasks.PAKET_SENDEN)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasPassed(UserTasks.PAKET_PACKEN) // + .hasPassed(UserTasks.PAKET_PRUEFEN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasPassed(Gateways.GATEWAY_14EVKAP) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasPassed(UserTasks.PAKET_PACKEN) // + .hasPassed(UserTasks.PAKET_PRUEFEN) // + .hasPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasPassed(UserTasks.PAKET_SENDEN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isEnded() // + .variables() // + .contains(entry(VAR_KUNDENNUMMER, "C-123A456"), entry(VAR_VORNAME, "Max"), entry(VAR_ERSTATTUNG, false), entry(VAR_NACHNAME, "Mustermann"), entry(VAR_BESCHAEDIGT, false)); // + + } + + @Test + @Deployment(resources = {"retoure.bpmn", "\\schuh_vernichtung_spende.dmn"}) + public void vernichtenErstattung() { + + ProcessInstance processInstance = runtimeService() // + .startProcessInstanceByKey("Retoure", withVariables(VAR_BESCHAEDIGT, true, VAR_ERSTATTUNG, true, VAR_KUNDENNUMMER, "C-123A456")); // + + assertThat(processInstance) // + .isStarted() // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasNotPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + complete(task(UserTasks.WARENDATEN_ERFASSEN), withVariables(VAR_MARKE, "Luxury Foot", VAR_PREIS, 350)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasNotPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + complete(task(UserTasks.WARE_VERNICHTEN)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasPassed(UserTasks.WARE_VERNICHTEN) // + .hasPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasNotPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + Map<String, Object> variableSnapshot0 = runtimeService() // + .getVariables(processInstance.getId()); // + List<LockedExternalTask> lockedTasks0 = lockTasks("customer"); + complete(getLockedTask(lockedTasks0, ServiceTasks.KUNDENDATEN_ERMITTELN), ExternalServiceMockProvider.customerProvider(variableSnapshot0)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasPassed(UserTasks.WARE_VERNICHTEN) // + .hasPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + Map<String, Object> variableSnapshot1 = runtimeService() // + .getVariables(processInstance.getId()); // + variableSnapshot1.put(VAR_SERVICEIDENTIFIER, "getData"); + List<LockedExternalTask> lockedTasks1 = lockTasks(lockedTasks0, "financial"); + complete(getLockedTask(lockedTasks1, ServiceTasks.FINANZDATEN_ERMITTELN), ExternalServiceMockProvider.financialMock(variableSnapshot1)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasPassed(UserTasks.WARE_VERNICHTEN) // + .hasPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + Map<String, Object> variableSnapshot2 = runtimeService() // + .getVariables(processInstance.getId()); // + variableSnapshot2.put(VAR_SERVICEIDENTIFIER, "refund"); + List<LockedExternalTask> lockedTasks2 = lockTasks(lockedTasks1, "financial"); + complete(getLockedTask(lockedTasks2, ServiceTasks.ERSTATTUNG), ExternalServiceMockProvider.financialMock(variableSnapshot2)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasPassed(UserTasks.WARE_VERNICHTEN) // + .hasPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasPassed(ServiceTasks.ERSTATTUNG) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasPassed(Events.RETOURE_ENDE) // + .hasNotPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isEnded() // + .variables() // + .contains(entry(VAR_KUNDENNUMMER, "C-123A456"), entry(VAR_EMAILGESENDET, "Nein"), entry(VAR_MARKE, "Luxury Foot"), entry(VAR_IBAN, "DE12345678900000123456"), entry(VAR_VORNAME, "Max"), entry(VAR_ERSTATTUNG, true), entry(VAR_NACHNAME, "Mustermann"), entry(VAR_BESCHAEDIGT, true)); // + + } + + @Test + @Deployment(resources = {"retoure.bpmn", "\\schuh_vernichtung_spende.dmn"}) + public void casetill1() { + + ProcessInstance processInstance = runtimeService() // + .startProcessInstanceByKey("Retoure", withVariables(VAR_BESCHAEDIGT, true, VAR_ERSTATTUNG, true, VAR_KUNDENNUMMER, "123")); // + + assertThat(processInstance) // + .isStarted() // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasNotPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + Map<String, Object> variableSnapshot0 = runtimeService() // + .getVariables(processInstance.getId()); // + List<LockedExternalTask> lockedTasks0 = lockTasks("customer"); + complete(getLockedTask(lockedTasks0, ServiceTasks.KUNDENDATEN_ERMITTELN), ExternalServiceMockProvider.customerProvider(variableSnapshot0)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasNotPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + Map<String, Object> variableSnapshot1 = runtimeService() // + .getVariables(processInstance.getId()); // + variableSnapshot1.put(VAR_SERVICEIDENTIFIER, "getData"); + List<LockedExternalTask> lockedTasks1 = lockTasks(lockedTasks0, "financial"); + complete(getLockedTask(lockedTasks1, ServiceTasks.FINANZDATEN_ERMITTELN), ExternalServiceMockProvider.financialMock(variableSnapshot1)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasNotPassed(ServiceTasks.ERSTATTUNG) // + .hasNotPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasNotPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasNotPassed(Events.RETOURE_ENDE) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isNotEnded(); // + + Map<String, Object> variableSnapshot2 = runtimeService() // + .getVariables(processInstance.getId()); // + variableSnapshot2.put(VAR_SERVICEIDENTIFIER, "refund"); + List<LockedExternalTask> lockedTasks2 = lockTasks(lockedTasks1, "financial"); + complete(getLockedTask(lockedTasks2, ServiceTasks.ERSTATTUNG), ExternalServiceMockProvider.financialMock(variableSnapshot2)); + + assertThat(processInstance) // + .hasPassed(Events.RETOURE_START) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT) // + .hasPassed(ManualTasks.WARE_EINSORTIEREN) // + .hasPassed(Gateways.GATEWAY_BESCHAEDIGT_CLOSE) // + .hasPassed(ServiceTasks.KUNDENDATEN_ERMITTELN) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG) // + .hasPassed(ServiceTasks.FINANZDATEN_ERMITTELN) // + .hasPassed(ServiceTasks.ERSTATTUNG) // + .hasPassed(Gateways.GATEWAY_NEUSENDUNG_CLOSED) // + .hasPassed(Gateways.GATEWAY_PARALLEL_LAGER_NEUSENDUNG_CLOSED) // + .hasPassed(Events.RETOURE_ENDE) // + .hasNotPassed(UserTasks.MANUELLE_PRUEFUNG) // + .hasNotPassed(ServiceTasks.WARENNUMMER_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT_CLOSED) // + .hasNotPassed(UserTasks.PAKET_PACKEN) // + .hasNotPassed(UserTasks.PAKET_PRUEFEN) // + .hasNotPassed(Gateways.GATEWAY_EINPACKUNG_FEHLERHAFT) // + .hasNotPassed(UserTasks.PAKET_SENDEN) // + .hasNotPassed(Gateways.GATEWAY_AUSPACKEN) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_NORMAL) // + .hasNotPassed(Gateways.GATEWAY_14EVKAP) // + .hasNotPassed(ManualTasks.WARE_AUSPACKEN_LUXUS) // + .hasNotPassed(UserTasks.WARENDATEN_ERFASSEN) // + .hasNotPassed(BusinessRuleTasks.VERNICHTUNG_ERMITTELN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG) // + .hasNotPassed(UserTasks.WARE_VERNICHTEN) // + .hasNotPassed(Gateways.GATEWAY_VERNICHTUNG_CLOSE) // + .hasNotPassed(UserTasks.WARE_SPENDEN) // + .isEnded() // + .variables() // + .contains(entry(VAR_IBANREFUND, "DE80123084556"), entry(VAR_FIRSTNAME, "Till"), entry(VAR_VORNAME, "till"), entry(VAR_LASTNAME, "Brinkhus"), entry(VAR_SERVICEIDENTIFIER, "getData"), entry(VAR_BESCHAEDIGT, false), entry(VAR_KUNDENNUMMER, "123"), entry(VAR_EMAILGESENDET, "Ja"), entry(VAR_PREIS, 1234), entry(VAR_MARKE, "wer"), entry(VAR_IBAN, "DE80123084556"), entry(VAR_ERSTATTUNG, true), entry(VAR_CONFIRMATIONEMAILSENT, "Ja"), entry(VAR_NACHNAME, "Brinkhus"), entry(VAR_PAKETTYP, "Normalverpackung"), entry(VAR_PAKET, true)); // + + } +} diff --git a/OnlineSchuhDemo/src/test/java/de/sample/onlineschuhdemo/Testcollection.bpmn-testgen b/OnlineSchuhDemo/src/test/java/de/sample/onlineschuhdemo/Testcollection.bpmn-testgen index a3e370d639b0308284f3835734131d57043fe069..4cc8a594f58ba11186ef9800a2ee85d369ee29db 100644 --- a/OnlineSchuhDemo/src/test/java/de/sample/onlineschuhdemo/Testcollection.bpmn-testgen +++ b/OnlineSchuhDemo/src/test/java/de/sample/onlineschuhdemo/Testcollection.bpmn-testgen @@ -153,4 +153,13 @@ Test vernichtenErstattung for Flow_4 with variables for Retoure_Start : [ kundennummer = "C-123A456" , erstattung = true , beschaedigt = true ] , with variables for Warendaten_erfassen : [ marke = "Luxury Foot" , preis = 350 ] with check : [ kundennummer == "C-123A456" , marke == "Luxury Foot" , iban == "DE12345678900000123456" , vorname == "Max" , nachname == "Mustermann" , emailGesendet == "Nein" , erstattung == true , beschaedigt == true ] -with mocks : [ financialMock , customerProvider ] ; \ No newline at end of file +with mocks : [ financialMock , customerProvider ] ; + +Test casetill1 for Flow_0 +with variables for Retoure_Start : [ kundennummer = "123" , erstattung = true , beschaedigt = true ] +with check : [ kundennummer == "123" , marke == "wer" , iban == "DE80123084556" , vorname == "till" , nachname == "Brinkhus" , pakettyp == "Normalverpackung" , emailGesendet == "Ja" , firstname == "Till" , lastname == "Brinkhus" , ibanRefund == "DE80123084556" , confirmationEmailSent == "Ja" , serviceIdentifier == "getData" , preis == 1234 , erstattung == true , paket == true , beschaedigt == false ] +with mocks : [ financialMock , customerProvider ] ; + +Test casetill2 for Flow_0 +with variables for Retoure_Start : [ kundennummer = "12345" , erstattung = true , beschaedigt = true ] +with mocks : [ financialMock , customerProvider ] ; diff --git a/OnlineSchuhDemo/testgen.json b/OnlineSchuhDemo/testgen.json index bef43d0747f685a0b0d3a8c76b9739dea40a0d55..e57c02b124c1c1dcd8290c590f329806051395f0 100644 --- a/OnlineSchuhDemo/testgen.json +++ b/OnlineSchuhDemo/testgen.json @@ -3,7 +3,8 @@ "testPackage": "de.sample.onlineschuhdemo", "testPath": "\\src\\test\\java\\de\\sample\\onlineschuhdemo\\", "modelPath": "\\src\\main\\resources", - "embeddedFilePath": "\\src\\main\\webapp" + "embeddedFilePath": "\\src\\main\\webapp", + "projectRootPath": "C:\\Users\\tillb\\Desktop\\fe_projekt\\fe-pda-testing-tool\\OnlineSchuhDemo" }, "bpmnFiles": [ { diff --git a/Testgenerator/src/main/java/de/fhmuenster/masterthesis/Testgenerator/rest/service/change/ChangeController.java b/Testgenerator/src/main/java/de/fhmuenster/masterthesis/Testgenerator/rest/service/change/ChangeController.java new file mode 100644 index 0000000000000000000000000000000000000000..a7b3bf9d7a575069da18b235f5dc830c559eb6a0 --- /dev/null +++ b/Testgenerator/src/main/java/de/fhmuenster/masterthesis/Testgenerator/rest/service/change/ChangeController.java @@ -0,0 +1,59 @@ +package de.fhmuenster.masterthesis.Testgenerator.rest.service.change; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.apache.commons.io.FileUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.config.annotation.EnableWebMvc; + +import de.fhmuenster.masterthesis.Testgenerator.rest.service.project.Project; +import de.fhmuenster.masterthesis.Testgenerator.rest.service.project.ProjectService; + +@RestController +public class ChangeController { + + @Autowired + private ProjectService projectService; + + @RequestMapping(path = "/project/{projectId}/match", method = RequestMethod.GET) + public String test() { + boolean success = true; +// +// +// if(success) { +// System.out.println("success"); +// return "success"; +// } +// else + + String[] keywords = { "Flow Flow_", "with elements", "without elements"}; + try { + BufferedReader reader = new BufferedReader(new FileReader("C:\\Users\\tillb\\Desktop\\fe_projekt\\fe-pda-testing-tool\\OnlineSchuhDemo\\dsl_matching\\Testcollection1.bpmn-testgen")); + String line = reader.readLine(); + while(line !=null) + { + for(int i = 0 ; i<keywords.length;i++){ + if(line.startsWith(keywords[i])){ + // do something if(line.contains(keywords[i])){ + System.out.println(line); + + } + } + line=reader.readLine(); + } + } catch (Exception ex) { + System.out.println(ex.getMessage()); + } + + return "false"; + } +}