How to use task and state in jbpm 4.4 - state

I am trying to use jbpm 4.4 for a workflow solution where, the UI is provided by a web application.
Here I am trying to assign a certain task to a user and expect him/her to perform certain action on it...
like "Approve", "Reject" and "Approve with remarks"..
All of these actions need to have separate processing.
What I am not able to understand is,
should I use a task element :
OR a state (wait state) element:
Idea is, I will let the user click on the "Approve", "Reject" and "Approve with remarks" buttons in an jsp page and I want to convey this to the process engine, through jbpm APIs.
Need some help/pointers on this.
TIA

As #Rodrigo has mentioned, need to use Task element. This answers the question.

Related

Detect Presence in AWS AppSync

I am working on an app that relies heavily on detecting when users go offline and go back online. I wanted to do this with AWS AppSync, but I can't seem to find a way to do this in the documentation. Is there a way to do it in AppSync?
Thanks for the question. Detecting presence is not currently support out of the box but you can likely build similar features yourself depending on the use case.
For example, a resolver on a subscription field is invoked every time a new device tries to open a subscription. You can use this resolver field to update some data source to tell the rest of your system that some user is currently subscribed. If using something like DynamoDB, you can use a TTL field to have records automatically removed after a certain amount of time and then require a user to "ping" every N minutes to specify that they are still online.
You could also have your application call a mutation when it first starts to register the user as online, then have the application call another mutation when the app closes to register it as offline. You could combine this with TTLs to prevent stale records in situations where the app crashes or something prevents the call to register as offline.
Thanks for the suggestion and hope this helps in the meantime.

Editing the existing task in the task scheduler C++

I am started working on Windows10 Task Scheduler .
I am developing GUI application in that I have requirement to control the number of days interval for trigger the task.
Suppose If I enter 5 days in my GUI then it should trigger the task in 5 days. Likewise randomly user can change the days.
Currently I have a task which is already exists in the task Scheduler, in that I need to control the days for to trigger in the User Interface.
I have seen the examples of Task Scheduler in MSDN but all of them are related to creating a new task or retrieving the states of existing task.
I don't want to create a new task , I want to edit the existing same task every time.
I didn't find anything which is related to editing the task which is already present in Task Scheduler.
Requesting anyone to please help me in editing the time trigger days in C++ using Task Scheduler 2.0.
Seems like what you can do is get access to all the ITrigger instances that are defined for a given task. These provide you with a pretty straightforward interface through which you set trigger times/limits/repetitions etc. for the task.
You access these trigger objects through the ITaskDefinition's get_Triggers() method, which returns an ITriggerCollection which you can iterate to find your trigger. You get the ITaskDefinition object by callng IRegisteredTask's get_Definition() method. You get the IRegisteredTask object by calling ITaskFolder's GetTask() method. An instance of which, to begin with, you get by calling ITaskService's GetFolder() method. Few. Thank MS for this idea of an API.
If you need basic help finding headers and running code then there's a code example at the bottom of this documentation page that does something different than what you are requesting (it creates a new task, not accessing an existing one), but can provide you with all the necessary boilerplate snippets to get going.

Web service for monitoring user activity

For my master thesis I have to develop a web service that constantly monitors user interaction in a web application (recording, for example, the most clicked buttons or the most visited pages). The main goal of this project is to generate a set of behavioral profiles.
I have some experience with web services, but I feel I need some sort of starting point with this kind of project (similar projects, existing thesis or articles). Hope someone can help.
Assuming you are talking about restFul web services, a good starting point would be to list down all APIs that you think you will need in terms of GET, POST, PUT, DELETE methods.
For example, you might first need a list of all the buttons, links and pages in the website you are supposed to monitor (lets say getAllItems). Then for such individual items, you need to code to capture the 'onclick', 'onbuttonpress' etc events (lets say getOnClickForButtonA). You will have to save all this information periodically in a database.
When you have enough information in the database, you can write code to read this and generate some stats out of it.
So, a set of services to gather all info.
Set of services to store all this info.
Set of services to analyze gathered info.
Hope this helps!

Java web application for multiple users

I need to design and implement a Java web application that can be used by multiple users at the same time. The data that is handled by this application is going to be huge and may take about 5 minutes for a page to display the results(database records).
I had designed this application using HTML, Servlets and JSP. But when two users would try to get the records, only one user was able to view the results while the other faced an error.
I always thought a web application would take care of handling multiple users but this is not the case.
Any insights on this would be highly appreciated.
Thanks.
I always thought a web application would take care of handling multiple users but this is not the case.
They do if they're written correctly. Obviously yours is not. That's all we can tell you unless you give more information, most importantly details of the error shown to the second user.
One possibility is that everything is OK on the web layer but your DB access for the first user causes an exclusive lock so that the second user cannot access the data at the same time. This could be fixed by using non-exclusive read locks. How to do that depends mainly on what DB you're using.
Getting concurrency right requires you to choose the correct tools and use them correctly. It doesn't just happen magically because it's a web app.
What are are using to develop this web-application? If you are developing it in your own way from the start I must say you are trying to re-invent the same wheel which has been already created and enhanced by very solid frameworks.
I suggest you analyze your requirements thoroughly and study some available frameworks. Let them handle the things like multi threading and other aspects in the best possible manner.
Handling multiple request at a time is a container work and as an application developer we have to concentrate how we are handling and processing those requret being forwarded by the container.
I must suggest you to get some insight how web-application work and how request -response cycle happens

How do I programmatically access items in the Workbox?

How does Sitecore find these items? I want to set up a schedule task to email my admins when there are items pending in the Workbox. Maybe there is already a feature like this? The only piece of the puzzle I am missing is how to easily identify when/if Workbox items exist.
Instead of sending emails when an item is in a workflow state why don't you try using the RSS feeds that Sitecore generates for each state. Details are in the Client Configuration Cookbook.
The majority of email clients have built in RSS readers which typically will show the feed as a separate "inbox". IMHO this is much better than email alerts which often get ignored because of how spammy they can get.
The item is shown in the Workbox as long as it is in the workflow and not in the final state. Take a look at this shared source component - it seems to be just your requirement. This one is also quite similar.