Skip to content

ARE - a wrong expression in the MathEvaluator triggers a severe error in the slider #357

@benjaminaigner

Description

@benjaminaigner

Problem:
If there is a wrong expression (in this example: an additional bracket) in the MathEvaluator component triggers an error on model starting, stating that it is not possible to start the slider component (input of the MathEvaluator).

Cause:

2022-06-08 14:01:06.860 FINE [DeploymentManager runModel] Trying to start component instance: SliderInstance
2022-06-08 14:01:06.873 SEVERE [DeploymentManager runModel] java.lang.NullPointerException
	at org.cheffo.jeplite.JEP.getValue(JEP.java:176)
	at org.cheffo.jeplite.JEP.getValue(JEP.java:168)
	at eu.asterics.component.processor.mathevaluator.MathEvaluatorInstance.calculateAndProcessOutput(MathEvaluatorInstance.java:217)
	at eu.asterics.component.processor.mathevaluator.MathEvaluatorInstance$InputPort.receiveData(MathEvaluatorInstance.java:260)
	at eu.asterics.mw.model.runtime.impl.AbstractRuntimeOutputPort$1.run(AbstractRuntimeOutputPort.java:101)
	at eu.asterics.mw.services.AstericsModelExecutionThreadPool.execute(AstericsModelExecutionThreadPool.java:180)
	at eu.asterics.mw.model.runtime.impl.AbstractRuntimeOutputPort.sendData(AbstractRuntimeOutputPort.java:34)
	at eu.asterics.mw.model.runtime.impl.DefaultRuntimeOutputPort.sendData(DefaultRuntimeOutputPort.java:41)
	at eu.asterics.component.sensor.slider.SliderInstance.start(SliderInstance.java:353)
	at eu.asterics.mw.are.DeploymentManager.runModel(DeploymentManager.java:582)
	at eu.asterics.mw.services.AREServices.runModelInternal(AREServices.java:440)
	at eu.asterics.mw.services.AREServices$7.call(AREServices.java:409)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

2022-06-08 14:01:06.873 WARNING [DeploymentManager runModel] Plugin could not be started: Slider.1
2022-06-08 14:01:06.874 WARNING [AstericsErrorHandling reportError] Slider.1: Plugin could not be started: Slider.1

As it seems, the problematic expression is not handled in the MathEvaluator but propagates through to the slider.

Expected behavior:

The MathEvaluator component should display an error, like "malformed expression"

Example model: (due to file extension limitations, it is renamed to txt)
abgabe1.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions