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 Script Task Ċ import Ġcom . val b 3 r . bpmn . intellij . plugin . bpmn . api . info . PropertyType Ċ import Ġorg . am sh ove . k lu ent . shouldBe EqualTo Ċ import Ġorg . am sh ove . k lu ent . shouldBe Null OrEmpty Ċ import Ġorg . am sh ove . k lu ent . shouldBe True Ċ import Ġorg . am sh ove . k lu ent . should Have Single Item Ċ import Ġorg . junit . jupiter . api . Test Ċ Ċ private Ġconst Ġval ĠFILE Ġ= Ġ" custom - service - tasks / script - task . bpmn 2 0 . xml " Ċ Ċ internal Ġclass ĠActivity Script Task Test Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġparser Ġ= ĠActiv iti Parser () ĊĠĠĠ Ġprivate Ġval Ġelement Id Ġ= ĠB pmn Element Id (" script Service Task ") ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` Script Ġtask Ġis Ġparse able `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġprocess Object Ġ= Ġparser . parse ( FILE . as Resource () !! ) ĊĊĠĠĠĠĠĠĠ Ġval Ġtask Ġ= Ġread Script Task ( process Object ) ĊĠĠĠĠĠĠĠ Ġtask . id . shouldBe EqualTo ( element Id ) ĊĠĠĠĠĠĠĠ Ġtask . name . shouldBe EqualTo (" echo es Foo Bar ") ĊĠĠĠĠĠĠĠ Ġtask . documentation . shouldBe EqualTo (" Documentation Ġfor Ġscript Ġservice Ġtask ") ĊĠĠĠĠĠĠĠ Ġtask . async !!. shouldBe True () ĊĠĠĠĠĠĠĠ Ġ// ĠTODO Ġ' exclusive ' Ġ? ĊĠĠĠĠĠĠĠ Ġtask . is For Comp ensation !!. shouldBe True () ĊĠĠĠĠĠĠĠ Ġtask . script Format . shouldBe EqualTo (" bash ") ĊĠĠĠĠĠĠĠ Ġtask . auto Store Variables . shouldBe EqualTo ( false ) ĊĠĠĠĠĠĠĠ Ġtask . script Body . shouldBe EqualTo (" echo Ġ\" Foo ĠBar ! \" Ġ> Ġ/ tmp / foo . txt ") ĊĊĠĠĠĠĠĠĠ Ġ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 . SCRIPT _ FORMAT ] !!. value . shouldBe EqualTo ( task . script Format ) ĊĠĠĠĠĠĠĠ Ġprops [ PropertyType . AUTO _ STORE _ VARIABLE S ] !!. value . shouldBe EqualTo ( task . auto Store Variables ) ĊĠĠĠĠĠĠĠ Ġprops [ PropertyType . SCRIPT ] !!. value . shouldBe EqualTo ( task . script Body ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` Script Ġ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 . SCRIPT _ FORMAT , Ġvalue ). script Format . shouldBe EqualTo ( value )} Ġ(" groovy "); ĊĠĠĠĠĠĠĠ Ġ{ value : ĠBoolean Ġ-> Ġread AndUpdate ( PropertyType . AUTO _ STORE _ VARIABLE S , Ġvalue ). auto Store Variables . shouldBe EqualTo ( value )} Ġ( false ); ĊĠĠĠĠĠĠĠ Ġ{ value : ĠString Ġ-> Ġread AndUpdate ( PropertyType . SCRIPT , Ġvalue ). script Body . shouldBe EqualTo ( value )} Ġ(" { def Ġaa Ġ= Ġ 1 }") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` Script Ġtask Ġ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 . SCRIPT _ FORMAT ). script Format . shouldBe Null OrEmpty () ĊĠĠĠĠĠĠĠ Ġread AndSet Null String ( PropertyType . SCRIPT ). script Body . shouldBe Null OrEmpty () ĊĠĠĠ Ġ} ĊĠĠĠĠĊĠĠĠ Ġprivate Ġfun Ġread AndSet Null String ( property : ĠProperty Type ): ĠB pmn Script Task Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġread Script Task ( read AndUpdate Process ( parser , ĠFILE , ĠString Value Updated Event ( element Id , Ġproperty , Ġ" "))) ĊĠĠĠ Ġ} ĊĠĠĠĠĊĠĠĠ Ġprivate Ġfun Ġread AndUpdate ( property : ĠProperty Type , ĠnewValue : ĠString ): ĠB pmn Script Task Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġread Script 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 Script Task Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġread Script Task ( read AndUpdate Process ( parser , ĠFILE , ĠBoolean Value Updated Event ( element Id , Ġproperty , ĠnewValue ))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġread Script Task ( process Object : ĠB pmn Process Object ): ĠB pmn Script Task Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġprocess Object . process . body !!. script Task !!. should Have Single Item () ĊĠĠĠ Ġ} Ċ }