file Modelio Context Service using the Application API for Version 3.8

2 years 9 months ago #5719 by goradiar
Hello All,

I have been banging my head for the past couple of days trying to figure out how to implement the example listed here:

Modelio Context Service

I believe I need help with some of the context before implementing this code in Java - for example, where does the "MyModule" come from? If I create a class called "MyModule" using Eclipse and I try the code, this does not work obviously because it does not know the getInstance() part. I did setup the Java Project with Maven and followed the steps in the helloworld example to create an actual module but this is not what I really want. I am just trying to get information from the Modelio application using Java. Here is my code attempt and I tried to create another class not called MyModule and obviously that does not work either. Please let me know what I am doing wrong and Thank you for your help!
package org.modelio.test_v1.api;

import org.modelio.api.module.context.IModuleContext;

public class MyModule {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		IModule myModule = MyModule.getInstance();
		IModelioContext mCtx = myModule.getModuleContext().getModelioContext();



The errors I am getting are the following:

Exception in thread "main" java.lang.Error: Unresolved compilation problems:
IModule cannot be resolved to a type
The method getInstance() is undefined for the type MyModule
IModelioContext cannot be resolved to a type

at org.modelio.test_v1.api.MyModule.main(

Please Log in or Create an account to join the conversation.

2 years 4 months ago #5822 by ebr
Hi Goradiar,

Thansk for the feedback, we willl look at the Maven template but I can already point out that your Module must extends AbstractJavaModule from org.modelio.api.module package.

I would recommend you to take a look at the sources available at the Modelio community forge .


Please Log in or Create an account to join the conversation.

Moderators: tmachmaab
Time to create page: 0.033 seconds
^ Back to Top