package Ġcom . val b 3 r . bpmn . intellij . plugin . activ iti . parser . custom servic et ask s Ċ Ċ import Ġcom . val b 3 r . bpmn . intellij . plugin . activ iti . parser . Activ iti ObjectFactory Ċ import Ġcom . val b 3 r . bpmn . intellij . plugin . activ iti . parser . Activ iti Parser Ċ import Ġcom . val b 3 r . bpmn . intellij . plugin . activ iti . parser . as Resource Ċ import Ġcom . val b 3 r . bpmn . intellij . plugin . activ iti . parser . read AndUpdate Process Ċ import Ġcom . val b 3 r . bpmn . intellij . plugin . activ iti . parser . test events . Boolean Value Updated Event Ċ import Ġcom . val b 3 r . bpmn . intellij . plugin . activ iti . parser . test events . StringValue Updated Event Ċ import Ġcom . val b 3 r . bpmn . intellij . plugin . bpmn . api . B pmn Process Object Ċ import Ġcom . val b 3 r . bpmn . intellij . plugin . bpmn . api . bpmn . B pmn Element Id Ċ import Ġcom . val b 3 r . bpmn . intellij . plugin . bpmn . api . bpmn . elements . tasks . B pmn User Task Ċ import Ġcom . val b 3 r . bpmn . intellij . plugin . bpmn . api . info . PropertyType Ċ import Ġorg . am sh ove . k lu ent .* Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . junit . jupiter . api . assert Throws Ċ Ċ private Ġconst Ġval ĠFILE Ġ= Ġ" custom - service - tasks / user - task . bpmn 2 0 . xml " Ċ Ċ internal Ġclass ĠActivity User Task Test Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġparser Ġ= ĠActiv iti Parser () ĊĠĠĠ Ġprivate Ġval Ġelement Id Ġ= ĠB pmn Element Id (" user TaskId ") ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` User Ġtask Ġis Ġparse able `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġprocess Object Ġ= Ġparser . parse ( FILE . as Resource () !! ) ĊĊĠĠĠĠĠĠĠ Ġval Ġtask Ġ= Ġread User Task ( process Object ) ĊĠĠĠĠĠĠĠ Ġtask . id . shouldBe EqualTo ( element Id ) ĊĠĠĠĠĠĠĠ Ġtask . name . shouldBe EqualTo (" A Ġuser Ġtask ") ĊĠĠĠĠĠĠĠ Ġtask . documentation . shouldBe EqualTo (" A Ġuser Ġtask Ġto Ġdo ") ĊĠĠĠĠĠĠĠ Ġtask . async !!. shouldBe True () ĊĠĠĠĠĠĠĠ Ġ// ĠTODO Ġ' exclusive ' Ġ? ĊĠĠĠĠĠĠĠ Ġtask . is For Comp ensation !!. shouldBe True () ĊĠĠĠĠĠĠĠ Ġtask . assign ee . shouldBe EqualTo ("\ $ INIT I ATOR ") ĊĠĠĠĠĠĠĠ Ġtask . due Date . shouldBe EqualTo (" 2 0 2 0 - 0 1 - 0 1 ") ĊĠĠĠĠĠĠĠ Ġtask . category . shouldBe Null () Ġ// ĠUnsupported Ġby ĠActivity ĊĠĠĠĠĠĠĠ Ġtask . form Key . shouldBe EqualTo (" FORM _ KEY ") ĊĠĠĠĠĠĠĠ Ġtask . form Field Validation . shouldBe Null () Ġ// ĠUnsupported Ġby ĠActivity ĊĠĠĠĠĠĠĠ Ġtask . priority . shouldBe EqualTo (" 1 ") ĊĠĠĠĠĠĠĠ Ġtask . skip Expression . shouldBe Null () Ġ// ĠUnsupported Ġby ĠActivity ĊĊĠĠĠĠĠĠĠ Ġval Ġprops Ġ= ĠB pmn Process Object ( process Object . process , Ġprocess Object . diagram ). to View ( Activ iti ObjectFactory ()). elem Properties By Element Id [ task . id ] !! ĊĠĠĠĠĠĠĠ Ġprops [ PropertyType . ID ] !!. value . shouldBe EqualTo ( task . id . id ) ĊĠĠĠĠĠĠĠ Ġprops [ PropertyType . NAME ] !!. value . shouldBe EqualTo ( task . name ) ĊĠĠĠĠĠĠĠ Ġprops [ PropertyType . DOCUMENT ATION ] !!. value . shouldBe EqualTo ( task . documentation ) ĊĠĠĠĠĠĠĠ Ġprops [ PropertyType . ASYNC ] !!. value . shouldBe EqualTo ( task . async ) ĊĠĠĠĠĠĠĠ Ġprops [ PropertyType . IS _ FOR _ COMP ENS ATION ] !!. value . shouldBe EqualTo ( task . is For Comp ensation ) ĊĠĠĠĠĠĠĠ Ġprops [ PropertyType . ASSIGN EE ] !!. value . shouldBe EqualTo ( task . assign ee ) ĊĠĠĠĠĠĠĠ Ġprops [ PropertyType . D UE _ DATE ] !!. value . shouldBe EqualTo ( task . due Date ) ĊĠĠĠĠĠĠĠ Ġprops [ PropertyType . CATEGORY ]. shouldBe Null () ĊĠĠĠĠĠĠĠ Ġprops [ PropertyType . FORM _ KEY ] !!. value . shouldBe EqualTo ( task . form Key ) ĊĠĠĠĠĠĠĠ Ġprops [ PropertyType . FORM _ FIELD _ VALIDATION ]. shouldBe Null () ĊĠĠĠĠĠĠĠ Ġprops [ PropertyType . PRIORITY ] !!. value . shouldBe EqualTo ( task . priority ) ĊĠĠĠĠĠĠĠ Ġprops [ PropertyType . SKIP _ EXPRESSION ]. shouldBe Null () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` User Ġtask Ġis Ġup datable `() Ġ{ ĊĠĠĠĠĠĠĠ Ġ{ value : ĠString Ġ-> Ġread AndUpdate ( PropertyType . ID , Ġvalue ). id . id . shouldBe EqualTo ( value )} Ġ(" new ĠId "); ĊĠĠĠĠĠĠĠ Ġ{ value : ĠString Ġ-> Ġread AndUpdate ( PropertyType . NAME , Ġvalue ). name . shouldBe EqualTo ( value )} Ġ(" new ĠName "); ĊĠĠĠĠĠĠĠ Ġ{ value : ĠString Ġ-> Ġread AndUpdate ( PropertyType . DOCUMENT ATION , Ġvalue ). documentation . shouldBe EqualTo ( value )} Ġ(" new Ġdocs "); ĊĠĠĠĠĠĠĠ Ġ{ value : ĠBoolean Ġ-> Ġread AndUpdate ( PropertyType . ASYNC , Ġvalue ). async . shouldBe EqualTo ( value )} Ġ( false ); ĊĠĠĠĠĠĠĠ Ġ{ value : ĠBoolean Ġ-> Ġread AndUpdate ( PropertyType . IS _ FOR _ COMP ENS ATION , Ġvalue ). is For Comp ensation . shouldBe EqualTo ( value )} Ġ( false ); ĊĠĠĠĠĠĠĠ Ġ{ value : ĠString Ġ-> Ġread AndUpdate ( PropertyType . ASSIGN EE , Ġvalue ). assign ee . shouldBe EqualTo ( value )} Ġ(" Assigned Ġto "); ĊĠĠĠĠĠĠĠ Ġ{ value : ĠString Ġ-> Ġread AndUpdate ( PropertyType . D UE _ DATE , Ġvalue ). due Date . shouldBe EqualTo ( value )} Ġ(" 2 0 0 0 - 0 1 - 0 1 "); ĊĠĠĠĠĠĠĠ Ġ{ value : ĠString Ġ-> ĠassertThrows < IllegalStateException > Ġ{ read AndUpdate ( PropertyType . CATEGORY , Ġvalue ). category . shouldBe EqualTo ( value )}} Ġ(" SO ME _ CAT 1 2 3 "); ĊĠĠĠĠĠĠĠ Ġ{ value : ĠString Ġ-> Ġread AndUpdate ( PropertyType . FORM _ KEY , Ġvalue ). form Key . shouldBe EqualTo ( value )} Ġ(" KEY _ 9 0 "); ĊĠĠĠĠĠĠĠ Ġ{ value : ĠBoolean Ġ-> ĠassertThrows < IllegalStateException > Ġ{ read AndUpdate ( PropertyType . FORM _ FIELD _ VALIDATION , Ġvalue ). form Field Validation . shouldBe EqualTo ( value )}} Ġ( false ); ĊĠĠĠĠĠĠĠ Ġ{ value : ĠString Ġ-> Ġread AndUpdate ( PropertyType . PRIORITY , Ġvalue ). priority . shouldBe EqualTo ( value )} Ġ(" 2 2 "); ĊĠĠĠĠĠĠĠ Ġ{ value : ĠString Ġ-> ĠassertThrows < IllegalStateException > Ġ{ read AndUpdate ( PropertyType . SKIP _ EXPRESSION , Ġvalue ). skip Expression . shouldBe EqualTo ( value )}} Ġ(" #{ something . wrong () }") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` User Ġtask Ġis Ġfields Ġare Ġempty able `() Ġ{ ĊĠĠĠĠĠĠĠ Ġread AndSet Null String ( PropertyType . NAME ). name . shouldBe Null OrEmpty () ĊĠĠĠĠĠĠĠ Ġread AndSet Null String ( PropertyType . DOCUMENT ATION ). documentation . shouldBe Null OrEmpty () ĊĠĠĠĠĠĠĠ Ġread AndSet Null String ( PropertyType . ASSIGN EE ). assign ee . shouldBe Null OrEmpty () ĊĠĠĠĠĠĠĠ Ġread AndSet Null String ( PropertyType . D UE _ DATE ). due Date . shouldBe Null OrEmpty () ĊĠĠĠĠĠĠĠ ĠassertThrows < IllegalStateException > Ġ{ read AndSet Null String ( PropertyType . CATEGORY )} ĊĠĠĠĠĠĠĠ Ġread AndSet Null String ( PropertyType . FORM _ KEY ). form Key . shouldBe Null OrEmpty () ĊĠĠĠĠĠĠĠ Ġread AndSet Null String ( PropertyType . PRIORITY ). priority . shouldBe Null OrEmpty () ĊĠĠĠĠĠĠĠ ĠassertThrows < IllegalStateException > Ġ{ read AndSet Null String ( PropertyType . SKIP _ EXPRESSION )} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġread AndSet Null String ( property : ĠProperty Type ): ĠB pmn User Task Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġread User Task ( read AndUpdate Process ( parser , ĠFILE , ĠString Value Updated Event ( element Id , Ġproperty , Ġ" "))) ĊĠĠĠ Ġ} ĊĠĠĠĠĊĠĠĠ Ġprivate Ġfun Ġread AndUpdate ( property : ĠProperty Type , ĠnewValue : ĠString ): ĠB pmn User Task Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġread User Task ( read AndUpdate Process ( parser , ĠFILE , ĠString Value Updated Event ( element Id , Ġproperty , ĠnewValue ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġread AndUpdate ( property : ĠProperty Type , ĠnewValue : ĠBoolean ): ĠB pmn User Task Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġread User Task ( read AndUpdate Process ( parser , ĠFILE , ĠBoolean Value Updated Event ( element Id , Ġproperty , ĠnewValue ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġread User Task ( process Object : ĠB pmn Process Object ): ĠB pmn User Task Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġprocess Object . process . body !!. user Task !!. should Have Single Item () ĊĠĠĠ Ġ} Ċ }