How do you implement a project with many workflow? - java

I just got a project which I need to implement lots of workflows, and I am considering to use jbpm engine to implement those workflow, so I want to know is their limits which I need to think through before useing jbpm engine , or any alternates ?
Our workflow is something like following:
user fill in the application form => assistant manager approval => dept director approval => director approval => boss approval. And we need to customize the task forms and integrate with other legend system.
Is their any workflow foundation like in windows in Java ?
Any recommendation are greatly appreciated !

I have to say; my experience regarding workflow in both Java and .Net when it comes to the core libraries or API libraries was either under-featured or over complicated.
Saying that, I found that in most cases having a table with statuses did the trick. Let me explain.
Have a foreign key in the table which contains your application form referring to a status table.
Have the status table with an ID (PrimaryKey) Column and StatusName Column.
The statuses should include:
ID(1) Captured - User fill in application form.
ID(2) Pending Assistant Manager Approval - Assistant Manager Approval
etc for all of the statuses...
Have a user table or make usage Java - ACL which has group assignments for
each of the Users vs Groups.
Like for instance, the people / person who has access to Assistant Manager Approvals will be able to see the application forms which have a status of Captured.
You should get the picture by now.
On the other had I do find the jBPM very useful, but I also think it has its place in much bigger workflow environments.

Related

I can get the data from another application of the same topic

I have an application for students, but I see that users do not like the idea of re-entering all their information (of agenda and subjects) from scratch, I would like my application to have the option to "get data from X application if it detects that is installed ", just like the browsers Firefox and Chrome when you switch from one to the other they offer to import the history and other data. Some of the target applications allow you to export your SQLite databases and you could start there, but is it possible? is it legal? is it good practice?
If the answer is positive, some recommendation based on your experience?

newrelic - how to show more details for overview dashboard on JVM

I have a java application with newrelic agent. The overview dashboard displays "Web transactions response time" chart, but it does not break it down any further - just total time.
How to make it be more specific - how to divide whole "JVM" into several "subevents"?
The chart I'm referring to:
And here's how it could look like (random screen from the web):
In order to see the information you are looking for like we see in the screenshots you helpfully provided you'll need to do some configuration on your end. The Java agent can pick up the information you're looking for but you'll need to tell it to do so.
To give you a few specific examples:
Database: Provided you're using a supported database, we should get calls made to the database and make that part of the transaction. (See Java compatibility JDBC ) You would then see those reflected in the chart.
Web External: Calls you make to an outside service will show up if they are properly instrumented. You can find out more about capturing these calls from this KB document and this one.
Request queueing This is what happens before the request actually reaches your application (which is where the agent lives). You can learn more about this functionality in this KB document
What you are currently seeing in the graph is the remainder of the time the transaction took after the request was queued, any database or external calls were made and responses received.
If you need clarification or have further questions, please don't hesitate to ask.
Cheers,
Adrienne Kincaid | Tech Support Engineer | New Relic, Inc

fast global search using jsf, spring, hibernate

The project, on which i am working,is integrated on spring3, hibernate, jsf2.0, also using annotations.The project have different modules and each module have different processes and each process contains Master Details screens.In module, All Processes are dependent/related to one another from top to bottom.Custom search is developed throughout the module in each process.Now on the project requirements,it needs to develop global search throughout the Module.Each module has 90 database tables with huge data inside and there is a "Item Table" which is used throughout the Module(all processes details screens revised that item). Through global search user will enter an item and search it.Searching should returns all processes details in result(output) within seconds. As i already told above that each table also have huge data inside.What should be the mechanism to develop fast searching feature to avoid from System hanging or going down.
Overview:
Searching Flow:Suppose Item No:1234--> Module-->Each process -->Each process details-->items details found
Developing Tools: eclipse-jee-juno-win32 , Microsoft SQL Server.
I request every one who view this question please help me to share perfect solution as i get correct answer.I will apply correct answer in project.

Best way to build a chat bot

What framework can I start with to create a simple chatbot? the focus of the bot is very limited(for my project management website http://ayeboss.com).
One can compare it with SIRI on iPhone. I want to create a simple "answering" chat which will answer questions like "give me all completed tasks so far" or "show me last completed task" or "show|list|give me my pending tasks" etc. After user asks the question I want to present the data to the user
As of now I am creating a regex dictionary of possible questions and if there is no match then I do a lucene search to find the nearest match.
Am I doing it right?
Typically, chatbots within a narrow field like yours typically rely on 2 important concepts:
Intent detection: identifying what the user is requesting
Entity Extraction: Identifying entites in the users request. For instance in a flight reservation bot examples of entities are the source, destination and travel dates. In a weather bot the entities can be the desired date for the weather or the location where the weather is required.
For your specific type of chatbot, which has a definite goal of retrieving list of completed tasks and retrieving the last completed task. To develop this, you need to define the intents of interest. From you examples we can easily define 2 intents:
COMPLETED_TASKS_REQUEST
LAST_COMPLETED_TASK
Based on this 2 intents, there is really no entity to be detected. You simply query your service API to retrieve the requested information in each scenario.
The next phase will be to train a classifier to identify the intents. This can be done by getting some sample sentences for each request type and training over those.
The flow is then reduced to the following:
Bot receives message
Bot identifies intent
Bot extracts relevant entities (if required)
If intent is recognised bot queries data source to retrieve answer else bot complains it doesn't understand the request. Alternatively if bot needs an entity to complete request, bot asks user to provide the information and completes its task. This is usually called a slot based approach. You can read more on how a Dialog Manager works.
Note that if you're not into Machine Learning or NLP you can easily train an intent detector on platforms like wit.ai or api.ai and the entity classification part of this task will be reduced to simple http API requests. Though when building genuinely complicated or sophisticated bots it is almost always better to build your own models since you can have full control and can handle edge cases better. Platforms like wit.ai or api.ai generally need to perform well across multiple fields while you can focus on making yours an expert in task management.
Hope this helps.
PS: To make your bot more interesting we can add one more intent like retrieving the status of a specific task given the id. E.g a user can ask what is the status of task 54. This intent can be called:
TASK_STATUS_REQUEST. In this example, the intent has an entity which is the id of the requested task so you will need to extract that :)
This is a NLP task, and for building a system like this require lot of R&D. You can start by building a set of question that might be asked. Analyzing the questions and coming up with word patterns for each type of question. The next step would be to transform the English sentence into some form of formal structure( maybe SQL or lambda calculus). The backend DB should have the data stored in it which can be queried by the formal language.
The main problem lies in converting the English sentence to a formal language. You can start with regex and progress to make it more complex by checking Part of Speech, Syntactic structure of input sentences. Check out NLTK package for doing NLP tasks.
On top of chat bot library, you can integration instant messaging library like Hyphenate to enable chat bot for mobile and web communication.
Here're few simple steps:
Hyphenate Console: Create a chatbot entity by sign up an account at Hyphenate console (console.hyphenate.io) to give your chatbot an identity and a voice by creating Hyphenate IM account for the bot.
Platform SDK: Integrate your app (iOS, Android, or Web) with Hyphenate IM services and open source UI library.
Webhooks (event callback): Set up Hyphenate webhooks to receive the messages from the user that push to your developer backend, then process it in with your chatbot AI library.
Backend REST API: push chatbot's messages to the user via REST APIs provided by Hyphenate from your developer backend.
Hooray! Webhooks + backend REST API = relay messages between chatbot and user.
http://docs.hyphenate.io/docs/chat-bot-integration
You can use Microsoft NLP frameworks which are pretty straight forward and easy to use for beginners. Also was earlier know as LUIS, it's one of the Cognitive services that Microsoft provides.
It's basically a combination of API calls.
Not sure which language you are familiar with, but in Java you can do it using Apache OpenNLP library. This is a very good & easy to use library for natural language processing. To give very basic approach, you can break sentences & tokenize them into words. Then you can lemmatize words to get them to basic word forms. Then you can classify or categorize them using categorizer with proper training data. better the training, smarter the chat bot. Also you can select categories to make chat bot have conversation in more engaging way. Here is a very good article with detailed example & demo.

Run SQLite commands on database in one app from another

I have an SQLite database stored in the assets resources of one application used to load UI and other stuff into the app, mainly just holding text nothing out of the ordinary. I want to be able to get a writable version of this database so I can modify it from another application.
Example:
First application is on the market with limited number of enabled features. User gets to a certain point where they need to buy extra content to do more stuff in the app. The original app has these features but they are not enabled in the app using the database. I want the user then to download a second app from the market which is just used to change one field in the database from disabled to enabled thus unlocking the new features.
I have an idea I may need to use content providers but my understanding is once created they are accessible to all applications. I need it, for piracy reasons I guess, to only be able to communicate with apps signed off by my key.
Thanks
Sam,
I understand what you intend to do, but you are going about it the wrong way. Your 'Unlock App' would not be able to modify the Database in the assets folder of your 'Free App'. That's just general android security model stuff.
You may want to look at this question: How can I use the paid version of my app as a "key" to the free version?
It describes how you can create a 'Unlock App' on the market to unlock features of your 'Free app' without needing to actually modify any of the original data in the 'Free App'.
Good luck

Categories