file Modelio Context Service using the Application API for Version 3.8

1 month 5 days 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(MyModule.java:10)

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

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