Camunda experssion access to extensionElements - expression

I am new in camunda and I want to write a expression and want access to extensionElements like processInstaceId and formKey.
how can I do this?
please guide me.

Not sure what is formKey, but
in groovy script process instance - execution
in java you can take it like this:
import org.camunda.bpm.engine.impl.context.Context
import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity;
ExecutionEntity execution=Context.getBpmnExecutionContext().getProcessInstance();

Related

Kubernetes undefined noderesources.preFilterState

I am rewriting the logic of Kubernetes' NodeResourcesFit plugin, I want to use preFilterState like https://github.com/kubernetes/kubernetes/blob/419e0ec3d2512afd8c1f35a44862f856bc4ac10f/pkg/scheduler/framework/plugins/noderesources/fit.go#L91, so I import it in the code:
import "k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources"
and use it just like:
s, ok := c.(*noderesources.preFilterState)
However I get an error: undefined: noderesources.preFilterState
I am not familiar with Kubernetes, so I don't know what is wrong with it. Thanks for your patience.
I try to print noderesources.Name but it failed too.
According to the link you're providing, preFilterState is not exported and therefore not accessible from the outside of the package.
It has nothing to do with Kubernetes but with go:
example: https://go.dev/tour/basics/3
doc: https://go.dev/doc/effective_go#names
I have a feeling you are starting with go, I recommend you play a bit with the fundamentals of the language and maybe use an IDE/Text editor with intellisense to be able to know what you can and cannot call.

Jmeter - Functional Extent Report

I would like to use Extent Report in Jmeter for functional testing. Please suggest some sample script and language, library to do this. I explored our page and unable to get the lib and steps to implement them.
I followed the Using extentreports for jmeter test results
However, I am getting error message
Typed variable declaration : Class: ExtentReports not found in namespace
I am using extentreports-3.1.2.jar and kept inside the Jmeter Lib folder. Also I have imported them in the script as well.
Have you tried to look at Extents reports documentation? It seems to be comprehensive enough.
I don't know what you mean by "use Extent Report in Jmeter for functional testing", but given you're asking for a sampler code here is a minimal snippet suitable for using in any JSR223 Test Element assuming Groovy as the language:
import com.aventstack.extentreports.ExtentReports
import com.aventstack.extentreports.Status
import com.aventstack.extentreports.reporter.ExtentSparkReporter
import com.aventstack.extentreports.reporter.configuration.ViewStyle
def extentReports = new ExtentReports()
def reporter = new ExtentSparkReporter("report", ViewStyle.SPA)
extentReports.attachReporter(reporter)
def firstTest = extentReports.createTest("SomeTest")
firstTest.log(Status.PASS, 'Everything ok')
extentReports.flush()
You will need to:
Have extentreports-4.1.7.jar in JMeter Classpath (as well as all it's dependencies if you will be using MongoDB as the reporting backend)
Restart JMeter to pick the .jar up

Execute a XQuery script directly from Gradle instead of from QConsole

I would like to execute a XQuery script directly from Gradle instead of from QConsole.
How to do that?
Is there a mlGradle task for that? Or we could define a task like running MLCP from gradle?
You can create a custom task that extends the ServerEvalTask.
As demonstrated in the Custom tasks that talk to the Client REST API WIKI page
task myXQueryTask(type: com.marklogic.gradle.task.ServerEvalTask) {
xquery = "my XQuery code here"
}
If you are looking to read the contents of the code from a particular file, instead of a static string, then could instead do something like:
new File('/path/to/file').getText('UTF-8')

Sending set of parameters for IN statement to restful service

I think it is a very basic question, but Im new working on this. What I need is to build a webservice that receives a set of id's for building an IN statement.
something like that:
And the url would be something like that:
... service1/semovie/120,121
Is it possible??
Can you tell me how can I create my template/handler?
Many thanks
Regards.
I've got it! . This is how I configured my service:
And this is the output:

How to import data to sonarqube database?

I have my own report in a custom format and I want to import it somehow to sonar database to use sonar's widgets to show it. Is it possible in general? Is there any tools to do it?
This will require a custom plugin. Not knowing what type of data you're dealing with, I'll guess that the Generic Test Coverage plugin might be a good model.
You shoud try to do it using the webservice api. That's the recommanded way to do it.
The supported api is self documented on your SQ instance. Here is the API of the nemo instance : http://nemo.sonarqube.org/api_documentation

Resources