My question is if it is possible to split up OCL files and reuse methods of another OCL document.
Example:
import 'transitive_test.ecore'
package transitive_test
context Bank
def:
collectionToString(col : Collection(OclAny)) : String =
col->iterate(obj : OclAny; result : String = '' |
result.concat(obj.toString()).concat('\n')
)
inv Valid_Customer:
collectionToString(self.customer)
endpackage
Now I would like to split up this OCL file into an OCL file with utility methods and the invariants.
OCLDocument1:
import 'transitive_test.ecore'
package transitive_test
context Bank
def:
collectionToString(col : Collection(OclAny)) : String =
col->iterate(obj : OclAny; result : String = '' |
result.concat(obj.toString()).concat('\n')
)
endpackage
And OCLDocument2:
import 'transitive_test.ecore'
--pseudocode
using module1
package transitive_test
context Bank
inv Valid_Customer:
collectionToString(self.customer)
endpackage
The reason is I have a kind of large OCL document(500+ lines) and I would like to separate the invariants from the utility methods. I could not find anything related to "modularizing" OCL so i presume it's not possible, but I wanted to ask anyway.
Regards