[JBoss jBPM] - Re: Problem execute actions on jboss
by asmo
In the meantime, i could isolate the problem a little bit.
If i create a processinstance direct on the parsed processdefinition, jbpm executes the action.
step 1:
try{
|
| JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance("jbpm.cfg.xml");
|
|
| JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
| GraphSession graphSession = jbpmContext.getGraphSession();
|
| ProcessDefinition processDefinition =ProcessDefinition.parseXmlResource("activityWorkflow.par/processdefinition.xml");
|
| ProcessInstance processInstance = processDefinition.createProcessInstance();
|
| processInstance.signal("startWorkflow");
| processInstance.signal("created");
|
| jbpmContext.save(processInstance);
|
| }catch(Exception e){
| e.printStackTrace();
| }finally{
| jbpmContext.close();
| }
| }
If i first save the processInstance and later load it back from the database, the action won't execute.
JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance("jbpm.cfg.xml");
|
| JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
|
| try{
| GraphSession graphSession = jbpmContext.getGraphSession();
|
| ProcessDefinition processDefinition =ProcessDefinition.parseXmlResource("activityWorkflow.par/processdefinition.xml");
|
| ProcessInstance processInstance = processDefinition.
| Long id = Long.valueOf(processInstance.getId());
|
| jbpmContext.deployProcessDefinition(processDefinition);
| jbpmContext.save(processInstance);
| }catch(Exception e){
| e.printStackTrace;
| }finally{
| jbpmContext.close();
| }
| return id;
step 2:
JbpmConfiguration jbmpConfiguration = JbpmConfiguration.getInstance("jbpm.cfg.xml");
| JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
| try{
| GraphSession graphSession = jbpmContext.getGraphSession();
|
| ProcessInstance processInstance = graphSession.loadProcessInstance(processId.longValue());
|
| processInstance.signal();
| jbpmContext.save(processInstance);
| }catch(Exception e){
| e.printStackTrace;
| }finally{
| jbpmContext.close();
| }
Is there something wrong in the way i save and load the processInstance?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977515#3977515
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977515
19 years, 7 months
[EJB 3.0] - Large data insert generates no line at database
by abra20
Hello!
Im facing a problem and Im completely lost at it.
I get the file through JSF component.
What I have to do is read the file, line by line instantianting a new Entity that will have
this String as an attribute. So, I create a List of the entities created.
List list = new ArrayList();
while((line=reader.readLine)!=null)
{
EntityB b = new EntityB();
b.value = line;
list.add(b);
}
Also, I have another Entity that will receive this List.
EntityA a = em.getEntityA(id);
a.setBEntities(list);
Finally, I try to merge EntityA, as I use cascade, EntityB will also be persisted.
em.merge(a);
First problem:
What is the best way of passing the file or its content to my SessionBean(Stateless)
so I can iterate the content and persist it?
What Im doing is read the UploadedFile (Adf Component) and write the content to a java.io.File,
so I can pass it to the SessionBean but I dont think this is a good thing because these uploaded
files are about 50 - 150 thounsand lines.
Second problem:
How do I persist those thousands of entities objects I created?
I call em.persist and none is persisted.
I tried to insert through native query and also no line is inserted.
However when I try a smaller File with 15 thousand lines, the task is successfully done.
Appreciate some help!
Thanks!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977514#3977514
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977514
19 years, 7 months
[Tomcat, HTTPD, Servlets & JSP] - URL problems using Apache, JBoss, mod_jk
by mlriggins
Hello,
I hope someone can help. I'm very new at this and I am still trying to
figure out what I am doing.
I have configured Apache on Machine 1 and JBoss on Machine 2 using
mod_jk. After much trial and error, I finally got things working. I
have a war file that exists on Machine 2 that I need to use for my site
named Corporate.war. However, when I attempt to access my url
www.example.com from the internet I get an error. When I use the url
www.example.com/Corporate the site opens just fine. How do I tell
Apache to open the site using www.example.com? I have made numerous
changes to the VirtualHost in httpd.conf to no avail.
Another problem I am having is that my site is not displaying static
images located on Machine 2. Those images are not located in the same
directory as the DocumentRoot, they are back one directory.
Basic VirtualHost I am using:
<VirtualHost *:80>
ServerName www.example.com
ServerAdmin a...(a)mycompany.com
DocumentRoot 'C:\jboss-4.0.1RC2\server\default\deploy'
JkMount /*.war loadbalancer
JkMount /Corporate loadbalancer
JkMount /Corporate/* loadbalancer
JkMount /*.jsp loadbalancer
JkMount /servlet/* loadbalancer
ErrorLog logs/example.com-error.log
CustomLog logs/example.com-access.log common
Thank you in advance for any and all suggestions.
Monica
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977511#3977511
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977511
19 years, 7 months