donderdag 12 november 2015

Mendix and the Simple Charts

I've been struggling a few hours with generating statistics and then looked forward to creating some bar charts and pie charts. It was supposed to be simple.

If you know what you are doing, then sure, it's simple enough :)

For the bar chart, just create some a table and some data for the X-axis and a label for the Y-axis and you're good to go.
For a pie chart, you need to create a separate table with a label and a value, then create a list of these name/value pair objects and commit. Put the label on the X-axis and the value on the Y-axis.

However, the implementation of the pie chart is not super (november 2015). In the Features tab selecting Show Legend and Show Hover have no effect. The only way to manipulate the Simple Chart is by using the Extra options field. You know, that one which says 'this property should be omitted'.

There is no error checking on this, so it's a matter of trying out the various options to see what works and what not.
When you do start on this, some pointers:



Example 1:
{
        series: {
            pie: {
                show: true,
                label: {
                  threshold: 0.02
                }
            }
        },
        legend: {
              show: 'true'
        }
}

This will show a legend.
It will show only labels on the pie chart for sections which are larger than 2%



Example 2:
{
        series: {
            pie: {
                show: true,
                combine: {
                    color: '#999',
                    threshold: 0.05,

                    label: 'different than the others'
                }

            }
        },
        legend: {
              show: 'true'
        }
}

This will do the same as example 1, but then instead of not showing a label on a section, instead it will combine all sections smaller than 5% into one big section 'Other'. If you also specify the label parameter as I did here in this example, it will change the caption of the other category into 'different than the others'.


woensdag 29 april 2015

Mendix webservices: cannot find the declaration of element 'S:Body'

While working on an integration issue between 2 Mendix Apps, we kept running into an issue where a locally developed and tested integration worked fine, but after deploying it on the Test environment, errors kept occurring. Debugging led to the specific error " cannot find the declaration of element 'S:Body' " and in the java stack trace the mention of the Xerces libray, which handles Java webservice integration. Most likely (pending further investigation...) this means it's a server environment configuration issue. It seems to be that Mendix is not able to interpret (deserialization?) the incoming request. Can it be the the SOAP library is not available?

There are 2 options we are exploring:
- newer JRE version to be installed on the server
- settings of the VM need to be updated as the server is running On Premise.
This is our current approach for further researching a solution for this error:
There is an issue since Java 7, causing timeouts when using Web Services with a certain amount of data. You can circumvent this issue by adding the VM params "-Djava.net.preferIPv4Stack=true". The Mendix Business Modeler will do this for you but if you are running Mendix on premise on a Windows server you will need to do this yourself.
As found in the Mendix System Requirements.

"An error has occurred" in the Mendix UI: webservice with bad endpoint constant configuration

When working with webservices I kept on receiving the very clear (not) message "An error has occurred" in the Mendix UI. Locally developed and tested, all was fine, but when moved to the test environment, this kept popping up.
Debugging gave no further details, stack trace and additional logging showed a SOAP "fault" HTTP 200 OK.
However, under water a webservice was invoked, and for end point resolving we used a constant which is configurable for each environment; that is where it went wrong.

Locally the endpoint was configured correctly, but on the test server environment the endpoint was set to http://something.test.local/ws-doc/GetPersonList?wsdl
Obviously not the right endpoint, but no proper error information was available hinting at this.
So, check your endpoint configuration if you run into this error, when using Mendix webservices!

Moving on.... to Mendix

Since early this year I moved to the (rather)new and exciting platform Mendix. It is a platform that allows for Model Driven Development. Mendix makes it possible to very quickly generate interpretable models for business processes, which are recognizable for business end users, but allow for (Java) developers to still do what they want, just without needing to write thousands of lines of code. So from now on I will only post about Mendix and no longer SOA Suite.