TM1 with Java
- tianoklein
- Posts: 41
- Joined: Fri Jun 13, 2014 1:23 pm
- OLAP Product: TM1
- Version: 10.2.2
- Excel Version: 2013
TM1 with Java
Hello Folks!
I would like to create an application with JAVA using TM1 like a Database (Create, Insert, Update, Delete cubes/dimensions/elements).
It is possible ? How can I do it?
Any help will be welcome!
I would like to create an application with JAVA using TM1 like a Database (Create, Insert, Update, Delete cubes/dimensions/elements).
It is possible ? How can I do it?
Any help will be welcome!
-
- Site Admin
- Posts: 1454
- Joined: Wed May 28, 2008 9:09 am
Re: TM1 with Java
Suggest you look at the Java Extensions for TM1:
https://www.ibm.com/developerworks/comm ... Integrator
Note that the description is misleading. The intended use is for creating Java routines to be called from within TI. I don't find your post completely clear but I think you are talking about calling TI functions from within Java - but a good subset of the TI commands are supported by the Java Extensions. I don't know for sure that you can use them other than by embedding them in a call from TI but it may be possible.
On a side note -
https://www.ibm.com/developerworks/comm ... Integrator
Note that the description is misleading. The intended use is for creating Java routines to be called from within TI. I don't find your post completely clear but I think you are talking about calling TI functions from within Java - but a good subset of the TI commands are supported by the Java Extensions. I don't know for sure that you can use them other than by embedding them in a call from TI but it may be possible.
On a side note -
- TM1 is a database - just not a relational database.using TM1 like a database
- tianoklein
- Posts: 41
- Joined: Fri Jun 13, 2014 1:23 pm
- OLAP Product: TM1
- Version: 10.2.2
- Excel Version: 2013
Re: TM1 with Java
Hello David,
Wow!
That was exactly what I was looking for. I will study more to understand how it works...
but ...
Would you have some sample scripts (can be very simple) using these features?
Wow!
That was exactly what I was looking for. I will study more to understand how it works...
but ...
Would you have some sample scripts (can be very simple) using these features?
- tianoklein
- Posts: 41
- Joined: Fri Jun 13, 2014 1:23 pm
- OLAP Product: TM1
- Version: 10.2.2
- Excel Version: 2013
Re: TM1 with Java
What i really want is maintain a dimension with a java application.
I mean, create, update, delete,insert, search, etc.
Do you thinks its possible with TI java extension?
Thanks for help-me!
I mean, create, update, delete,insert, search, etc.
Do you thinks its possible with TI java extension?
Thanks for help-me!
- qml
- MVP
- Posts: 1094
- Joined: Mon Feb 01, 2010 1:01 pm
- OLAP Product: TM1 / Planning Analytics
- Version: 2.0.9 and all previous
- Excel Version: 2007 - 2016
- Location: London, UK, Europe
Re: TM1 with Java
This is exactly what it's for. You can either replace your TI scripts with Java classes (well, almost), or use them to enrich your TI routines. Either way, you should be able to do pretty much all ETL tasks, including the activities that you mention.tianoklein wrote:What i really want is maintain a dimension with a java application.
I mean, create, update, delete,insert, search, etc.
Do you thinks its possible with TI java extension?
Kamil Arendt
- tianoklein
- Posts: 41
- Joined: Fri Jun 13, 2014 1:23 pm
- OLAP Product: TM1
- Version: 10.2.2
- Excel Version: 2013
Re: TM1 with Java
Hello qml,
Many thanks for your advice.. will be very useful...
I would really appreciate if you had any examples to share with me. Could be very simple.
Many thanks for your advice.. will be very useful...
I would really appreciate if you had any examples to share with me. Could be very simple.
- tianoklein
- Posts: 41
- Joined: Fri Jun 13, 2014 1:23 pm
- OLAP Product: TM1
- Version: 10.2.2
- Excel Version: 2013
Re: TM1 with Java
Hello folks,
I tried to create a simple java code to create items in a Dimension, but doesn't work.
Any advice will be welcome!
I tried to create a simple java code to create items in a Dimension, but doesn't work.
Any advice will be welcome!
Code: Select all
static TM1Dimension dimCreateElement(TM1Server oServer, String dimName, String elmName) {
TM1Dimension sd;
TM1Element elm = TM1Element.NullElement;
int elementTYPE = TM1ObjectType.ElementSimple;
sd = oServer.getDimension(dimName);
String[] s_fields;
s_fields = new String[2];
s_fields[0] = "test1";
s_fields[1] = "test2";
sd.register(oServer, dimName);
sd.register(oServer, elmName);
sd.insertElement(elm, s_fields[1], elementTYPE);
return null;
}
-
- MVP
- Posts: 264
- Joined: Mon Nov 03, 2014 8:23 pm
- OLAP Product: TM1
- Version: 9.5.2 10.1 10.2 PA2
- Excel Version: 2016
Re: TM1 with Java
You probably want something more like this:
Code: Select all
static TM1Dimension dimCreateElement(TM1Server oServer, String dimName, String elmName) {
TM1Dimension sd;
TM1Element elm = TM1Element.NullElement;
int elementTYPE = TM1ObjectType.ElementSimple;
sd = oServer.getDimension(dimName);
TM1Element newElem = sd.insertElement(elm, elmName, elementTYPE);
if( newElem.isError() )
{
return null;
} else {
return newElem;
}
}
- tianoklein
- Posts: 41
- Joined: Fri Jun 13, 2014 1:23 pm
- OLAP Product: TM1
- Version: 10.2.2
- Excel Version: 2013
Re: TM1 with Java
Hello BrianL,
Thanks for your reply.
I tried de code, but now the variable newElement have de Error below:
Error: ObjectIsRegistered
Thanks for your reply.
I tried de code, but now the variable newElement have de Error below:
Error: ObjectIsRegistered
-
- MVP
- Posts: 264
- Joined: Mon Nov 03, 2014 8:23 pm
- OLAP Product: TM1
- Version: 9.5.2 10.1 10.2 PA2
- Excel Version: 2016
Re: TM1 with Java
Sorry, Dimension require the duplicate, edit, and update steps. You are not allowed to make edits directly to the public (registered) dimension. That's the error message you were seeing.
To correct it, you first create a duplicate dimension, make all your edits to that duplicate dimension, then call updateDimension when you are done editing to make your changes public.
To correct it, you first create a duplicate dimension, make all your edits to that duplicate dimension, then call updateDimension when you are done editing to make your changes public.
Code: Select all
static TM1Dimension dimCreateElement(TM1Server oServer, String dimName, String elmName) {
TM1Dimension sd;
TM1Element elm = TM1Element.NullElement;
int elementTYPE = TM1ObjectType.ElementSimple;
sd = oServer.getDimension(dimName);
sdCopy = sd.duplicate();
TM1Element newElem = sdCopy.insertElement(elm, elmName, elementTYPE);
if( newElem.isError() )
{
return null;
} else {
sd = sd.updateDimension(sdCopy);
return null;
}
}
- tianoklein
- Posts: 41
- Joined: Fri Jun 13, 2014 1:23 pm
- OLAP Product: TM1
- Version: 10.2.2
- Excel Version: 2013
Re: TM1 with Java
Wow.. Thank you...
Now it's working...But, where did you find this information? I searched for all the web...and nothing...
I wouldn't want to importune you all the time...
Now it's working...But, where did you find this information? I searched for all the web...and nothing...
I wouldn't want to importune you all the time...