cancel
Showing results for 
Search instead for 
Did you mean: 

Java Activiti Inputs

chunnu
Champ in-the-making
Champ in-the-making
I am learning Java Activiti in order to connect a process through Java Spring MVC.

I have used the Java Service Task and my code executes. What I want to do is when the process starts I want the client to send inputs. For example send a name. How is this possible through Java Activiti? I have tried all things but can't find what I need.

Also, I would like the process to output something.
16 REPLIES 16

jbarrez
Star Contributor
Star Contributor
Read my quote:

If you're adventurous and want to have an easier way, check trunk:

Which means that it is the unreleased version of the next Activiti, yes 😉

So you'd need to use the first option if you stick with 5.10.

chunnu
Champ in-the-making
Champ in-the-making
Hi

For the 1st option I get a NullPointerException when trying the following

I get the History service, invoke createHistoricDetailQuery method. I then use the processInstanceId singleResult method.

When using the HistoricDetail object returned gives a NullPointerException.

Any ideas why?

Also I would like to downcast this to HistoricVariableUpdate so I can get the value of the process output variable. Still I get a NullPointerException.

jbarrez
Star Contributor
Star Contributor
I'm not following: can you copy the exact line you try to execute. The Query api shouldn't give any null pointer exceptions

chunnu
Champ in-the-making
Champ in-the-making

ProcessInstance processInstance =getRuntimeService().startProcessInstanceByKey(“process1“, map);
HistoricDetail j =getHistoryService().createHistoricDetailQuery().processInstanceId(processInstance.getProcessInstanceId()).singleResult();

j is null map is a Map<String,Object> = new HashMap<String, Object>

jbarrez
Star Contributor
Star Contributor
DId you enable history? What history level are you running on.

To be safe, set the history level to 'full', you should at least get something back then.

chunnu
Champ in-the-making
Champ in-the-making
Hi

How do you turn it on?

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Uhhhmmm… By reading the documentation?
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.