include "Simantics/Entity" hiding (nameOf) import "Simantics/Model" import "UI/Progress" import "http://www.simantics.org/Issue-1.2" as ISSUE type Issue = Resource type Severity = Resource issuesOf :: Model -> [Issue] issuesOf model = recurse ISSUE.Issue model where recurse t r = do cs = children r issues = filter isIssue cs issueGrp = filter (not . isIssue) cs issues + concatMap (recurse t) issueGrp isIssue r = isInstanceOf r ISSUE.Issue importJava "org.simantics.issues.common.IssueUtils" where @JavaName newUserIssueForModel newUserIssueForModel :: Model -> String -> Severity -> [Resource] -> Issue userIssueAdvanced :: Model -> String -> Severity -> [Resource] -> Issue userIssueAdvanced model label severity contexts = do newUserIssueForModel model label severity contexts importJava "org.simantics.issues.common.IssueUtils" where @JavaName newUserIssueForModel userIssue :: () -> Issue importJava "org.simantics.db" where @JavaName Issue data IssueI importJava "org.simantics.db.layer0.validation.ValidationUtils" where @JavaName validateConstraintsForDomain validateDomain :: Resource -> [IssueI] importJava "org.simantics.modeling.utils.BatchValidations" where @JavaName runAll runAllBatchValidations :: ProgressMonitor -> Resource -> Resource -> () importJava "org.simantics.issues.common.RunActiveValidations" where @JavaName run runActiveValidations :: ProgressMonitor -> Resource -> ()