Activiti Engine Process Definition Listeners - java

I am building a solution on top of the Activiti Engine (5.9). I need to take some actions right after a new process definition (*.bpmn20.xml) has been deployed or undeployed.
I found a post in the Activiti Forums (post here) with some pointers, like hooks for new a process XML definition being parsed or building some logic around the engine database tables. The post is almost a year old; I am hoping that the situation has changed since then.
So, my question is twofold:
To the people who might have had a similar requirement, how did you approach the problem and what were the pros and cons of your solution?
To the the Activiti project owners, is such a feature considered for the roadmap?
Thanks,

We had a similar problem were we needed to "hack" into the engine. We hoped Activiti will create a central bus or notifications but it seems it will take some time for what we understood. I have wrote a blog post here, where you can see what we did. Hope it will help...

Related

Multiple users login in Spring application

I'm currently working on a java project with Spring and Postgres on Heroku, with most functions finished, but I've run into a major problem:
Whenever several users log in at the same time, their login information and data interferes with one another, due to my naive implementation: a "user" variable in the controller, which is a singleton and is shared across all users.
Why this doesn't work makes sense to me, but I'm not sure how to approach this problem. I should mention that I have very little experience with web development.
I've searched for possible fixes and it looks like there are multiple solutions, such as using Session Beans, servlets, java's httprequest and other functions, Spring Security, or instance variables? I've attempted tutorials for these, but probably due to my inexperience, I have yet to get one solution working for my existing code + Spring + Heroku.
My question is this - Which avenue is the best for me to pursue in order to solve my problem? It feels like there is are very simple fixes to this problem but right now I'm not sure what to try next. Simplicity is preferred and security is not a current concern for this project. If someone could point me in the right direction I would really appreciate it.
All my server-side code, with the exception of class files, is currently in the main controller java file, which used to be the "Getting Started With Java" file from Heroku. Many online examples have controllers in multiple files, which I don't know how to integrate into my existing project.
This is my first question on this site; if there's something I should add to my question, or if this isn't the right place to ask, please let me know. I'm also unsure if any of my code would be helpful for this question.
There can be a simple solution, try to reduce the scope of the user variable. Currently, you have a "user" variable in the controller, which is a singleton and is shared across all users, making it local and reducing its scope can solve your problem.

Are there no active owners for the spring cloud aws project anymore?

I see no activity within the last couple of months in the project spring-cloud-aws. No issues get answered, no PRs get reviewed or merged. This is a problem for my team, because we're trying to use this module, as we're heavily relying on spring boot apps and on sqs queues, but there are new features which does not get included into the module anymore, for example list typed message attributes for SNS messages.
One of my colleagues even opened a PR fixing the above issue, but there is no reaction. I do not really know how to raise awareness of this problem within the spring team.
Is the Spring developer team even aware of this issue and just don't care or is it unknown for them? If someone could take ownership of the project, at least for approving PRs, that would be great. I personally, would not really want to write custom implementations for integrating with AWS, or use the raw API without spring.
Unfortunately this sort of thing happens often to OSS. You may want to re-upload this as a derivative so changes can be made by you and the community once more.
This project is under the Apache license so derivatives are perfectly OK.

Getting started on exploring a complex java project

In the project allocated to me I have to understand a big Java project which uses Spring framework and angularjs for the frontend and I don't know where to start with. There is a lot of code running on the server (Jetty) and lots of logs generated. The back-end code is more of an interest for me than the UI side.
My question is where do I start? The Java code that we use for practice in college/academics very simple and had a 'main' method to start with.
In the big project I don't see a main method. How do I find out the 'starting point' of the project and then explore it further?
This question is somewhat similar but not exactly to Understanding a big company project in Java
One possible way to start exploring is find an important entry point to the application and then analysis layer to layer from code to code.
My following explanation is based on the information you have give in the comments of your questions. (application is based on angularjs and spring). It would be a good idea to adjust your question, so that these important informations are a part of the question (comments are temporary and could be removed without notice)
Start the application and find one of it's main functionality (or the functionality you want to extend on the next task).
Open the developer tools of your favourite browser and record all requests and responses. Trigger the action you want to discover. Analysis the records and find the corresponding REST call. Look at the request and response param and think about what this API should do.
Then you search for the corresponding REST-Controller inside the backend code. In most situation you can find it, if you search for some of the latter values of the REST-Call-URL path (which is bind to the controller or a controller method).
Now you have your entry point for that action and you can discover further on more or less similar as you would do it on a main method.
You can repeat this steps to get a understanding of the implementation of some features (one by one). Nevertheless there could be some important part of the application you will not find with this approach. But it would give you a starting point to explore the functions which are exposed by the web-interface to the user.
Depending on the architecture it might be that you find a place with some central core functionality. Then it would be a good idea to explore these core functions independently of the api to the frontend. If the application f.e. would take advance of a domain driven design approach you would find a layer where a functional (not technical) domain is designed. Then you will find the bigger picture here.
If you have anyone who know how the application is designed you should of course start you discovery by interviewing this person. If every one who has knowledge is not reachable, you have to look at some documentation or you have to discover the application on your own like I try to describe.

databinder for wicket concept & status

Seems like Wicket + DataBinder(https://github.com/wicket-databinder/wicket-databinder) is good solution if you know only plain java and need to write data-driven web app, as i am. But when i use auth functionality of dataBinder i gain error - when i register new user my password and confirm password not match. I look into the code - getConvertedInput() of RSAPasswordTextField return some long Base64 and it's different for password fields. I don't find databinder auth examples on net. Question and thought:
What is the common way of using current version of DataBinder? For example, how i can use net.databinder.auth.components.hib.DataSignInPage?
There is many todo comments in databinder. What of databinder features is stable?
I like that common web functionality is already in databinder, so i don't need reinvent the wheel. Maybe there is more actual alternative for that?
Otherwise i can contribute to databinder. Anyway i need to develop my application, so i can start from that is already in databinder. But i need status of modules(what works and how to use/what not work and what to do). Sorry for my english.
As far as I know, Nathan (author of databinder) has moved on to scala development, and databinder has since been stuck. Your best avenue is to contact Nathan, or one of the 10 forks on github to see how you can reignite development of databinder.
As I don't use databinder, I can't answer this one
I'd see the todo comments as a good pointer to where you can pick up maintaining the code base
There are several libraries that integrate with Wicket in various forms of maintenance.
Today databinder have no contributors. I write to Fausto Bencosme (he was the last). We try to use DataBinder together, but few problems occur. Fausto recommend to use Ebean. I try - looks like it works. So for newbies i recommend Ebean to.

Stopwatch Java API

Is there something out there that would allow me to create static object in my class or extend my class and give me functions to start, stop time configure statistics collection with properties file and bunch of other goodies I don't even know about.
I'm working on app that has crazy amount of threads running at any given moment and making sense out of the log files is becoming increasingly difficult. That's why I'm looking for some kind of a solution to help me with that.
Ideally I would like to have bean in my spring application context that would pretty much automate all the tracking of running treads based on annotation which would allow to configure the names of threads and accuracy of the stopwatch. Also ability to hooking it up with database instead of just log file would be great as well.
Maybe you want the apache commons StopWatch class?
Since you are already using Spring, you could use the Spring StopWatch, though it does not meet your additional goals of being able to persist the data. Note that it is not intended for production use, just for additional information during development and testing.
I'm not entirely sure I understand what you are trying to achieve.
Are you looking for keeping statistics on some time-line and exporting those to a a data source using some plugin API?
It might be worth your while to look at the Stats package of Twitter commons, they just open-sourced it not too long ago, so documentation and examples are still scarce, you will need to understand it mostly on your own, but I think this is what you are after.
Source
Javadoc

Categories