Camunda admin servlet context menu change - bpmn

Camunda by default register under context path '/lib','/app' and '/api' (e.g. camunda cockpit). Problem here is that I need change these to something like '/camunda/*'.
Any idea where to change it? From the source code it rather seems to be hardcoded.
Thank you

In spring boot you can influence the context path via application.properties/application.yaml using:
server:
servlet:
context-path: /camunda

Related

How to deploy a Camunda modeled diagram into Camunda Tomcat

I am trying to set up a BPMN workflow with Camunda. For this, I already made a diagram using the Camunda modeler. Now I want to open this BPMN diagram in Camunda. Camunda's Tomcat is installed and running, but I can't manage to upload/ find the diagram in Camunda's Tomcat. I am currently trying this on my local machine.
Anyone who knows how to get a BPMN diagram into Camunda's Tomcat?
In addition to the ways to deploy described by #MuffinMICHI you can also deploy your diagram via the REST API. You just make POST request to /engine-rest/deployment/create
You set Content-Type to:
application/x-www-form-urlencoded
You set these parameters:
deployment-name: <SOME NAME>
deployment-source: <SOME NAME>
data: <UPLOAD THE DIAGRAM HERE>
diagram (optional): <UPLOAD IMAGE FOR DIAGRAM>
There are two ways how you can upload your diagram to your BPMN engine.
In the Camunda Modeler, there is a little upwards-pointing arrow in the menu bar. There you can specify where your engine is running and
upload the diagram directly from the modeler.
https://docs.camunda.org/get-started/quick-start/service-task/
If you also have some JavaDelegate-classes you want to deploy with
your diagram, you can pack all these things in a WAR-file and put it
in the webapps-folder of your Tomcat which will then
automatically deploy your file.
https://docs.camunda.org/get-started/java-process-app/service-task/
The provided links guide you to the official Camunda documentation where all these things are explained in detail.
a) You can deploy directly from the modeler to the server.
https://docs.camunda.org/get-started/quick-start/deploy/
In the latest release the feature has improved further:
https://blog.camunda.com/post/2019/10/camunda-modeler-3.4.0-released/
On a local setup use rest endpoint http://localhost:8080/engine-rest if using on of the prepacked distributions or http://localhost:8080/rest if using Spring boot.
b) Process and decisions models (bpmn, dmn) can be auto-deployed. For instance placing the files into the src/main/resources folder (on a default Spring boot setup) will auto-deploy during startup.
c) There are other auto-deploy configuration options: https://docs.camunda.org/manual/latest/user-guide/spring-framework-integration/deployment/
d) You can use the REST-API, for instance with Postman to deploy.
https://docs.camunda.org/manual/latest/reference/rest/deployment/post-deployment/
Examples:
https://github.com/rob2universe/camunda-rest-postman
https://forum.camunda.org/t/process-deployment-to-rest-api-through-postman/10630
Deploy Camunda Process:-
https://docs.camunda.org/get-started/quick-start/deploy/
you can also use the play button to deploy if you are deploying the process for the first time.
camunda-spring-boot-starter is configured to use the SpringProcessEngineConfiguration auto deployment feature by default.
https://docs.camunda.org/manual/7.9/user-guide/spring-boot-integration/process-applications/

Spring Config Client - ConfigClientWatch

I am looking at the class ConfigClientWatch in the package package org.springframework.cloud.config.client;
I was expecting that I could use this to poll the server periodically to see if the config had changed and then execute an refresh.
I am not able to get this to work? How does the value
String newState = this.environment.getProperty("config.client.state");
Get updated.
I have not been able to find any documentation on this.
Thanks in Advance
Raghu
Unfortunately, this property is only used by Vault backend. Anyway, there is a thread in the Spring Config's GitHub proposing changes to support other backends such as Git.
If you are using Git-backed configurations, this solution may work for you:
https://github.com/spring-cloud/spring-cloud-config/issues/1378#issuecomment-492073851
Please, upvote the GitHub thread so this feature gets accepted.

DataSource naming JBossEAP 6.2 vs Web Logic

I am porting a suite of related applications from WebLogic to JBoss EAP v6.2.
I have set up a data source connection using the JBoss command line interface and hooked it to an oracle database. This database has a name of "mydatasource" and a JNDI name of
"java:jboss/datasources/mydatasource" as per JBoss standards. I can test and validate this database connection.
However, when I try to port the code and run it, the connection doesn't work. The code that worked in WebLogic was simply:
InitialContext ic = new InitialContext() ;
DataSource ds = (DataSource)ic.lookup(dataSource) ;
with a value in dataSource of "mydatasource".
This worked in Web Logic but in JBoss it throws a NameNotFoundException
javax.naming.NameNotFoundException: mydatasource-- service jboss.naming.context.java.mydatasource
Clearly there is a difference in how the InitialContext is set up between the two servers.
But this port involves a large number of small applications, all of which connect to the datasource via code like that above. I don't want to rewrite all that code.
Is there a way through configuration (InitialContextFactory, maybe) to define the initial context such that code like that above will work without rewriting, or perhaps is there another way of naming the datasource that JBoss will accept that would allow code like that above to work without rewriting?
Or must we bite the bullet and accept that this code needs a rewrite?
Update: Yes, I know that simply passing "java:jboss/datasources/mydatasource" to the InitialContext lookup solves the problem, but I am looking for a solution via configuration, rather than via coding if there is such a solution.
The way to do this correctly through configuration is to use
java:comp/env/jdbc/myDataSource
then use resource-ref in web.xml to map it to the declare datasource and use weblogic.xml or jboss-web.xml to actually map it to the real one
in weblogic admin console, when you define datasource it can be jdbc/realDataSource
JNDI path Tomcat vs. Jboss
For weblogic http://docs.oracle.com/cd/E13222_01/wls/docs103/jdbc_admin/packagedjdbc.html

How do I add a JNDI entry called "properties" in Glassfish on startup without using the admin?

In the code for our project there is this line:
(Properties) new InitialContext().lookup("properties")
One of the other developers said I had to add the entry through the admin for my instance of Glassfish. Having to use the admin to do this seemed suspect to me. Isn't there a way to add a JNDI entry at startup in web.xml, or something similar?
I think the idea here is that it must be done via the admin application so that the values aren't embedded in the application.

How to address JNDI configuration when using mvn scala:console

I'm troubleshooting a Mapper problem and I'm running into an issue trying to use a Mapper class inside of the Scala/Lift console. Our MetaMappers have their datasource configured through a ConnectionIdentifier that points to a JDBC datasource configured in JNDI. This works great when bootstrapping through Jetty.
When loading the console and running (new bootstrap.liftweb.Boot).boot to initialize, Schemifier.schemify fails JNDI configuration is not available.
scala> (new bootstrap.liftweb.Boot).boot
java.lang.NullPointerException: Looking for Connection Identifier ConnectionIdentifier(jdbc/svcHub) but failed to find either a JNDI data source with the name jdbc/svcHub or a lift connection manager with the correct name
at net.liftweb.mapper.DB$$anonfun$7$$anonfun$apply$12.apply(DB.scala:141)
at net.liftweb.mapper.DB$$anonfun$7$$anonfun$apply$12.apply(DB.scala:141)
at net.liftweb.common.EmptyBox.openOr(Box.scala:465)
at net.liftweb.mapper.DB$$anonfun$7.apply(DB.scala:140)
at net.liftweb.mapper.DB$$anonfun$7.apply(DB.scala:140)
at net.liftweb.common.EmptyBox.openOr(Box.scala:465)
at net.liftweb.mapper.DB$.newConnection(DB.scala:134)
at net.liftweb.mapper.DB$.getConnection(DB.scala:230)
at net.liftweb.mapper.DB$.use(DB.scala:581)
at net.liftweb.mapper.Schemifier$.schemify(Sche...
Essentially, I'd like to have full MetaMapper functionality from within the console. My question is: What's the best way to bootstrap a Lift app from the console such that the JNDI-based dependencies can also be fulfilled outside of a JNDI-capable web container?
Under a application server it's likely that the server will provide a JNDI context for you. In a standalone application you must provide a JNDI Context your self. For that you can use a javax.naming.InitialContext.
There is a nice example using Apache's DBCP here: http://commons.apache.org/dbcp/guide/jndi-howto.html. Of course, will you have to fix the Datasource objects to the implementation you are using.
This will be enough (not very elegant, though) for simple JNDI usage.