finos/rune-dsl

Generation exception if func input parameter not specified

hugohills-regnosys opened this issue · 0 comments

The below func does not specify the required input parameter for func call IsActionTypeTERM. It should generated a validation error.

func GetActionType: 
    inputs: reportableEvent ReportableEvent (1..1)
    output: action string (1..1)
    set action: 
        if IsActionTypeTERM // missing input variable
        then "TERM"
        else "ToDo"

With input parameter specified:

func GetActionType: 
    inputs: reportableEvent ReportableEvent (1..1)
    output: action string (1..1)
    set action: 
        if IsActionTypeTERM(reportableEvent)
        then "TERM"
        else "ToDo"

Causes exception in the ExpressionGenerator

[WARNING] Unexpected calling standard generate for rosetta -No value present - see debug logging for more
[INFO] Unexpected calling standard generate for rosetta
java.util.NoSuchElementException: No value present
    at java.util.Optional.get (Optional.java:143)
    at com.regnosys.rosetta.generator.java.expression.ExpressionGenerator.implicitVariable (ExpressionGenerator.java:682)
    at com.regnosys.rosetta.generator.java.expression.ExpressionGenerator.caseImplicitVariable (ExpressionGenerator.java:2302)
    at com.regnosys.rosetta.generator.java.expression.ExpressionGenerator.caseImplicitVariable (ExpressionGenerator.java:139)
    at com.regnosys.rosetta.utils.RosettaExpressionSwitch.doSwitch (RosettaExpressionSwitch.java:91)
    at com.regnosys.rosetta.utils.RosettaExpressionSwitch.doSwitch (RosettaExpressionSwitch.java:71)
    at com.regnosys.rosetta.generator.java.expression.ExpressionGenerator.javaCode (ExpressionGenerator.java:192)
    at com.regnosys.rosetta.generator.java.expression.ExpressionGenerator$13.appendTo (ExpressionGenerator.java:595)
    at org.eclipse.xtend2.lib.StringConcatenationClient.appendTo (StringConcatenationClient.java:51)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation.resolve (TargetLanguageStringConcatenation.java:59)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation$Preprocessor.process (TargetLanguageStringConcatenation.java:130)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation$Preprocessor.append (TargetLanguageStringConcatenation.java:108)
    at com.regnosys.rosetta.generator.java.expression.ExpressionGenerator$11.appendTo (ExpressionGenerator.java:559)
    at org.eclipse.xtend2.lib.StringConcatenationClient.appendTo (StringConcatenationClient.java:51)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation.resolve (TargetLanguageStringConcatenation.java:59)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation$Preprocessor.process (TargetLanguageStringConcatenation.java:130)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation$Preprocessor.append (TargetLanguageStringConcatenation.java:108)
    at com.regnosys.rosetta.generator.java.expression.ExpressionGenerator$10.appendTo (ExpressionGenerator.java:536)
    at org.eclipse.xtend2.lib.StringConcatenationClient.appendTo (StringConcatenationClient.java:51)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation.resolve (TargetLanguageStringConcatenation.java:59)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation$Preprocessor.process (TargetLanguageStringConcatenation.java:130)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation$Preprocessor.append (TargetLanguageStringConcatenation.java:108)
    at com.regnosys.rosetta.generator.java.expression.ExpressionGenerator$8.appendTo (ExpressionGenerator.java:475)
    at org.eclipse.xtend2.lib.StringConcatenationClient.appendTo (StringConcatenationClient.java:51)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation.resolve (TargetLanguageStringConcatenation.java:59)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation$Preprocessor.process (TargetLanguageStringConcatenation.java:130)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation$Preprocessor.append (TargetLanguageStringConcatenation.java:108)
    at com.regnosys.rosetta.generator.java.expression.ExpressionGenerator$7.appendTo (ExpressionGenerator.java:382)
    at org.eclipse.xtend2.lib.StringConcatenationClient.appendTo (StringConcatenationClient.java:51)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation.resolve (TargetLanguageStringConcatenation.java:59)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation$Preprocessor.process (TargetLanguageStringConcatenation.java:130)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation$Preprocessor.append (TargetLanguageStringConcatenation.java:108)
    at com.regnosys.rosetta.generator.java.expression.ExpressionGenerator$7.appendTo (ExpressionGenerator.java:398)
    at org.eclipse.xtend2.lib.StringConcatenationClient.appendTo (StringConcatenationClient.java:51)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation.resolve (TargetLanguageStringConcatenation.java:59)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation$Preprocessor.process (TargetLanguageStringConcatenation.java:130)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation$Preprocessor.append (TargetLanguageStringConcatenation.java:108)
    at com.regnosys.rosetta.generator.java.expression.ExpressionGenerator$6.appendTo (ExpressionGenerator.java:354)
    at org.eclipse.xtend2.lib.StringConcatenationClient.appendTo (StringConcatenationClient.java:51)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation.resolve (TargetLanguageStringConcatenation.java:59)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation$Preprocessor.process (TargetLanguageStringConcatenation.java:130)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation$Preprocessor.append (TargetLanguageStringConcatenation.java:102)
    at com.regnosys.rosetta.generator.java.expression.ExpressionGenerator$5.appendTo (ExpressionGenerator.java:318)
    at org.eclipse.xtend2.lib.StringConcatenationClient.appendTo (StringConcatenationClient.java:51)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation.resolve (TargetLanguageStringConcatenation.java:59)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation$Preprocessor.process (TargetLanguageStringConcatenation.java:130)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation$Preprocessor.append (TargetLanguageStringConcatenation.java:108)
    at com.regnosys.rosetta.generator.java.function.FunctionGenerator$35.appendTo (FunctionGenerator.java:1558)
    at org.eclipse.xtend2.lib.StringConcatenationClient.appendTo (StringConcatenationClient.java:51)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation.resolve (TargetLanguageStringConcatenation.java:59)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation$Preprocessor.process (TargetLanguageStringConcatenation.java:130)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation$Preprocessor.append (TargetLanguageStringConcatenation.java:108)
    at com.regnosys.rosetta.generator.java.function.FunctionGenerator$31.appendTo (FunctionGenerator.java:1338)
    at org.eclipse.xtend2.lib.StringConcatenationClient.appendTo (StringConcatenationClient.java:51)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation.resolve (TargetLanguageStringConcatenation.java:59)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation$Preprocessor.process (TargetLanguageStringConcatenation.java:130)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation$Preprocessor.append (TargetLanguageStringConcatenation.java:102)
    at com.regnosys.rosetta.generator.java.function.FunctionGenerator$24.appendTo (FunctionGenerator.java:872)
    at org.eclipse.xtend2.lib.StringConcatenationClient.appendTo (StringConcatenationClient.java:51)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation.resolve (TargetLanguageStringConcatenation.java:59)
    at com.regnosys.rosetta.generator.TargetLanguageStringConcatenation.preprocess (TargetLanguageStringConcatenation.java:50)
    at com.regnosys.rosetta.generator.java.util.ImportManagerExtension.buildClass (ImportManagerExtension.java:51)
    at com.regnosys.rosetta.generator.java.function.FunctionGenerator.generate (FunctionGenerator.java:162)
    at com.regnosys.rosetta.generator.RosettaGenerator$8.accept (RosettaGenerator.java:289)
    at com.regnosys.rosetta.generator.RosettaGenerator$8.accept (RosettaGenerator.java:261)
    at java.lang.Iterable.forEach (Iterable.java:75)
    at com.regnosys.rosetta.generator.RosettaGenerator.doGenerate (RosettaGenerator.java:320)
    at org.eclipse.xtext.generator.GeneratorDelegate.doGenerate (GeneratorDelegate.java:44)
    at org.eclipse.xtext.generator.GeneratorDelegate.generate (GeneratorDelegate.java:35)
    at org.eclipse.xtext.builder.standalone.StandaloneBuilder.generate (StandaloneBuilder.java:340)
    at org.eclipse.xtext.builder.standalone.StandaloneBuilder.launch (StandaloneBuilder.java:241)
    at org.eclipse.xtext.maven.AbstractXtextGeneratorMojo.internalExecute (AbstractXtextGeneratorMojo.java:171)
    at org.eclipse.xtext.maven.AbstractXtextGeneratorMojo.execute (AbstractXtextGeneratorMojo.java:144)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)