Compile scripts using dataweave library in Java - mule

I am trying to compile script using dataweave runtime library. Below is the sample code:
DataWeaveScript dataWeaveScript= weaveScriptingEngine.compile(script, NameIdentifier nameIdentifier, InputType[] implicitInputs, "application/json");
Can anyone help suggesting what should be passed in Name Identifier and InputType[].
Thanks in advance

Related

How can I parse info from kotlin docs to swagger-ui?

I need to parse kotlin docs (not swagger annotation) for swagger-ui.
I tried this, but it don't work.
Here my springdoc dependencies (springdocVersion = "1.6.6"). By the way, I can't use therapi version 0.13.0 if it's important.
runtimeOnly("org.springdoc:springdoc-openapi-kotlin:$springdocVersion")
implementation("org.springdoc:springdoc-openapi-ui:$springdocVersion")
implementation("org.springdoc:springdoc-openapi-webflux-ui:$springdocVersion")
implementation("org.springdoc:springdoc-openapi-javadoc:$springdocVersion")
annotationProcessor("com.github.therapi:therapi-runtime-javadoc-scribe:0.12.0")
implementation("com.github.therapi:therapi-runtime-javadoc:0.12.0")
After I replaced annotationProcessor("com.github.therapi:therapi-runtime-javadoc-scribe:0.12.0") with kapt("com.github.therapi:therapi-runtime-javadoc-scribe:0.12.0"), all worked well!
An example of the build file can be found here

Serenity BDD report generation

We are trying to generate reports for our tests using serenity BDD. But we couldn't find anything to help with report generation.If anyone is familiar with this,Please suggest any simple way to achieve this.
To generate a report you need to use apply plugin: 'net.serenity-bdd.aggregator' plugin in your build.gradle file. Also while executing your project use gradlew clean test aggregate command from your command line.
After execution you will find index.html report under \target\site\serenity
You can use the Groovy MarkUpBuilder and create customized reports for your use case. Basically, you'll need to create a markup builder instance in Groovy as below :
def xmlWriter = new FileWriter(file("${project.buildDir}/index.html"))
def xmlMarkup = new MarkupBuilder(xmlWriter)
Create custom tags using below sytax :
xmlMarkup.myCustomTag("Lorem Ipsum")
which will produce :
<myCustomTag>Lorem Ipsum</myCustomTag>
So, for a syntax like xmlMarkup.h1("Lorem Ipsum") you'll get the output as <h1>Lorem Ipsum</h1>
Then you can just create a gradle task which parses all the test outputs (xml or json) into HTML.
I had written an article about that in the past which you can find here

grammar.y error happended when compiled Cobalt

When compile Cobalt, the following error happend, is there anyone who knows why?
It said the 'ShadowType' is not a class or namespace in grammy.y:3421, I did not know what is used for grammy.y, and try to trace and modify the code, it does not work.
grammar.y error details
Your issue is that C++ version before C++0x does not support ShadowType::kBoxShadow(member in enum type) use at all, you can change the cflags_cc from "-std=gnu++98" to "-std=gnu++0x"in third_party/starboard/linux/shared/gyp_configuration.gypi, and try again.

common xsd schema imported into another schema not being unmarshalled

re http://blog.bdoughan.com/2011/12/reusing-generated-jaxb-classes.html
I am trying to switch from using castor to jaxb.
I am importing a commontypes.xsd schema into another schema and then using jaxb to generate the java classes but when I unmarhsal a sample XML file the imported types are null unless I explicitly set all the namespaces in the sample xml.
This is a real pain because I want calling apps to be able to send me plain XML not one littered with a tonne of namespaces and prefixes etc.
Any suggestions as to how to avoid having to do this?
I generated .episodes files in maven using the above article and XJC episode with maven but it doesnt help and Im still getting nulls when I unmarshal.
Can anyone help?
thanks
I got it working!
The problem was the package-info.java file generated by xjc from my .xsd file had elementFormDefault set to be QUALIFIED
#javax.xml.bind.annotation.XmlSchema(
namespace = "http://www.example.com/commontypes",
elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED
)
package com.example.commontypes;
When I changed this to be unqualified and recompiled the java code, the unmarshall then worked.
The root cause fix was in my .xsd file, where I set elementFormDefault="unqualified"
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.example.com/commontypes"
xmlns="http://www.example.com/commontypes"
elementFormDefault="unqualified"
attributeFormDefault="unqualified">
This resulting in the following generated package-info.java file
#javax.xml.bind.annotation.XmlSchema(
namespace = "http://www.example.com/commontypes"
)
package com.example.commontypes;
and again, the unmarshall then worked!
Thanks to Blaise for all the work he puts in, it was comment on one of his blog posts that let me figure it out!

Function pointers in C++/CLI

I am creating C++/CLI application in which I have using 3rd party tools API. One of the API has declaration in help documents as as
Error GetDrawingComponents(Drawing oDrawing,DrawingComponentVisit compVisit,DrawingComponentFilter compFilter)
Error (*DrawingComponentVisit) (DrwSolid solid,Error status)
Error (*DrawingComponentFilter) (DrwSolid solid,Error status,Filter filStatus)
Now I have used this API in my application in my .CPP I have used it like below-
Error chkError = GetDrawingComponents(Drawing oDrawing,(DrawingComponentVisit)oClsObj::VisitDrawingComponents,(DrawingComponentFilter)oClsObj::FilterDrawingComponents);
CPP file also contains defination of VisitDrawingComponents and FilterDrawingComponents. They are declared in .h file as following -
Error VisitDrawingComponents(DrwSolid solid,Error status);
Error FilterDrawingComponents(DrwSolid solid,Error status,Filter filStatus);
So now using it above way I am getting typecast error
Error 1 error C2440: 'type cast' : cannot convert from 'overloaded-function' to 'DrawingComponentVisit'
I Can use this API the same way if I have unmanaged C++ application. Please let me know waht changes I will need to do to make this work in C++/CLI application?