In order to upsert into an MDF Object which have attachment, first you have to upsert into the Attachment entity with the base64 encoded File String. This upsert will return the attachment ID. Then retrieve the attachment ID from the response and upsert into the MDF object. The attachment id can be retrieved with XPatch expression like this.
To format the datetime in XSLT, first convert it to date time, and use the XSLT function format-dateTime. For example use this to format to the pattern yyyy-MM-dd. Have fun 🙂
Upserting to OData entities in Successfactors need the date to be in the Unix (Epoch) time format. The normal datetime value can be changed to Unix time either by groovy script, or by XSLT. For eg, think the input XML like this :
We may need to create a date value in header/property, which could we use in the filter at a later point. Can be easily achieved using groovy script. Usually its very easily with normal java util class. But problems come when we have to add this based on a particular timezone. Code below :
The current datetime can be easily retrieved and assigned to a property or header with the Content Modifier Step like this. Use a Camel Expression like these :
${date:now:yyyy-MM-dd’T’00:00:00’Z’}
or
${date:now:yyyy-MM-dd}
based on the date format you need.
But the problem comes when you need the time in different timezone. For eg, I wanted time in CET, but the camel expression always gives the time in UTC zone. This could be tackled with a groovy script to convert the time into any desired timezone.
Was struggling with building my project using gradle for some time. Whenever i tried to build it, i get an error message “Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_131 contains a valid JDK installation.”. I made it double sure that my standard JVM is pointing to the JDK installation folder, not the JRE folder. Still getting the error, later I found out that gradle is taking the java.home for the build process. For that you can either start the eclipse through command line parameter for java.home.
Or the easy solution i found is, go to the gradle task you want to run, right click, go to gradle configuration, and in the Java Home tab, point to the JDK installation folder. Voila, it will build the project without crying.
While debugging Java code, Strings in the views “Variables” and “Expressions” show up only till a certain length, after which Eclipse shows “…”. Even after working with eclipse for 10 years it was a new info for me. There is a way to show the complete string.
In the Variables view you can right click on Details pane (the section where the string content is displayed) and select “Max Length…” popup menu. The same length applies to expression inspector popup and few other places. In the max length give 0 and you will see the whole values in the value box.