[JBoss jBPM] - Re: Is it possible to update a process def without versionin
by camunda
Hi Arshad,
we have implemented some code that can do easy updates to new process definitions (in the case when the new process has the same node). That code can easly be enhanced to give some node-map as tom mentioned.
This code will get into a jbpm action soon, but sadly I havn't got time for it the last weeks...
The current code looks like this:
| jbpmContext = getJbpmContext();
|
| ProcessInstance pi = jbpmContext.getGraphSession().loadProcessInstance(processId);
|
| changeTokenVersion(jbpmContext, pi.getRootToken(), newVersion);
|
| ProcessDefinition oldDef = pi.getProcessDefinition();
| ProcessDefinition newDef = jbpmContext.getGraphSession().findProcessDefinition(oldDef.getName(), newVersion);
|
| logger.debug("changes process id " + pi.getId() + " from version " + pi.getProcessDefinition().getVersion() + " to new version " + newDef.getVersion());
| // you need tthe right or a patched version for this, see http://jira.jboss.com/jira/browse/JBPM-585
| pi.setProcessDefinition(newDef);
|
| logger.debug("process id " + pi.getId() + " changed to version " + pi.getProcessDefinition().getVersion());
|
and
| private void changeTokenVersion(JbpmContext jbpmContext, Token token, int newVersion) {
| Node oldNode = token.getNode();
|
| ProcessDefinition oldDef = token.getProcessInstance().getProcessDefinition();
|
| ProcessDefinition newDef = jbpmContext.getGraphSession().findProcessDefinition(oldDef.getName(), newVersion);
| Node newNode = newDef.findNode(oldNode.getName());
|
| if (newNode == null) {
| throw new ConfigurationException("node with name '" + oldNode.getName() + "' not found in new process definition");
| }
|
| logger.debug("change token id " + token.getId() + " from version " + oldDef.getVersion() + " to new version " + newDef.getVersion());
|
| token.setNode(newNode);
|
| // change tasks
| Iterator<TaskInstance> iter = getTasksForToken(token).iterator();
| while (iter.hasNext()) {
| TaskInstance ti = iter.next();
|
| Task oldTask = ti.getTask();
| // find new task
| Query q = jbpmContext.getSession().createQuery(HibernateQueries.findTaskForNode);
| q.setString("taskName", oldTask.getName());
| q.setLong("taskNodeId", newNode.getId());
| // TODO: q.setLong("processDefinitionId", newDef.getId());
| Task newTask = (Task) q.uniqueResult();
|
| if (newTask == null) {
| throw new ConfigurationException("node '" + newNode.getName() + "' has no Task configured! Check the new process definition");
| }
|
| ti.setTask(newTask);
| logger.debug("change dependent task-instance with id " + oldTask.getId());
| }
|
| // change childs recursive
| Iterator childIter = token.getChildren().values().iterator();
| while (childIter.hasNext()) {
| changeTokenVersion(jbpmContext, (Token) childIter.next(), newVersion);
| }
| }
|
If you can wait for a little bit of time it will go into the jbpm core I think, if you need it now just enhance that code...
Hope that helps?
Bernd
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981528#3981528
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981528
19 years, 6 months
[EJB 3.0] - Enum as method argument throws exception at runtime when exp
by webmarck
Enum as method argument throws exception at runtime when exposed as Webservice
JBoss 4.0.5GA with EJB3 enabled
I have a stateless session bean with a method that takes a enum as a argument that I would like to expose as a webservice. The method looks like this
@WebMethod void resetDatabase(DatabaseType type);
Where DatabaseType is
public enum DatabaseType {
|
| CUSTOMERS, CLIENTS, ALL
| }
I have created a simple client that calls that method but I get the following exception
| Exception in thread "main" org.jboss.ws.WSException: Cannot obtain java type mapping for: {http://syncml.mpsuite.niro.dk/jaws}DatabaseType at org.jboss.ws.metadata.JSR109MetaDataBuilder.buildParameterMetaDataRpc(JSR109MetaDataBuilder.java:240)
| at org.jboss.ws.metadata.JSR109MetaDataBuilder.setupOperationsFromWSDL(JSR109MetaDataBuilder.java:189)
| at org.jboss.ws.metadata.JSR109ClientMetaDataBuilder.buildMetaDataInternal(JSR109ClientMetaDataBuilder.java:207)
| at org.jboss.ws.metadata.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:122)
|
Am I forgetting something or does the current version of EJB3 webservice not support enum?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981523#3981523
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981523
19 years, 6 months
[Beginners Corner] - First application in EJB 3.0 and JBoss 4.0.5GA
by zielonyplot
Hi!
I am brand new to EJB 3.0 programming and I need some help.
I have simple bean class (StatelessTekst1.java):
import org.jboss.annotation.ejb.LocalBinding;
| import javax.ejb.*;
|
| @Stateless
| public class StatelessTekst1 implements tekst1
| {
| public String podajTekst(int numer)
| {
| if(numer==1)
| return "Hej, udalo sie!";
| }
| }
And interface (tekst1.java):
public interface tekst1
| {
| public String podajTekst(int numer);
| }
I put this files to <JAVA_HOME>/bin directory. But, when I want to compile the StatelessTekst1.java file, I get an errors:
-------------------------------------------------------------------------------------
C:\Program Files\Java\jdk1.5.0_05\bin>javac StatelessTekst1.java
StatelessTekst1.java:1: package org.jboss.annotation.ejb does not exist
import org.jboss.annotation.ejb.LocalBinding;
^
StatelessTekst1.java:2: package javax.ejb does not exist
import javax.ejb.*;
^
StatelessTekst1.java:4: cannot find symbol
symbol: class Stateless
@Stateless
^
3 errors
-------------------------------------------------------------------------------------
So, I add the classpath to the javac:
C:\Program Files\Java\jdk1.5.0_05\bin>javac -classpath .;c:/"program files"/jboss/client/jboss-ejb3-client.jar;c:/"program files"/jboss/client/jboss-j2ee.jar StatelessTekst1.java
But again I have an error:
StatelessTekst1.java:1: package org.jboss.annotation.ejb does not exist
import org.jboss.annotation.ejb.LocalBinding;
^
1 error
What should I do to compile this files? Please, help me!
Thanks and best regards!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981520#3981520
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981520
19 years, 6 months
[JBossWS] - Re: JBossWS and UDDI
by noel.rocher@jboss.com
Hi,
The part that seems to fail is the service invocation (the final Clent run at the end of the example. All UDDI requests are ok :
| publisher-run:
| [echo] Publish the example ExampleService
| [java] - pulishing :
| [java] uddi inquiry URL = http://localhost:8080/juddi/inquiry
| [java] uddi publish URL = http://localhost:8080/juddi/publish
| [java] uddi user id = jboss
| [java] uddi password =
| [java] wsdl URL = http://localhost:8080/example/ExampleService?wsdl
| [java] business entity = JBoss
| [java] ...
| [java] - Using the Context ClassLoader
| [java] Retrieving document at 'http://localhost:8080/example/ExampleService?wsdl'.
| [java] - creating Business Entity name = JBoss ...
| [java] - No Business Entity "JBoss" found. Will be created.
| [java] - Business Entity "JBoss" created. Key = 29D27B50-666D-11DB-BB50-8D8F32423BEA".
| [java] - creating Business Service ...
| [java] - No Business Service "ExampleService" found. Will be created.
| [java] - Business Service created. Key = 2A057230-666D-11DB-B230-FCC92C392922".
| [java] - Port Type ...
| [java] - PortType Classifications : [org.apache.ws.scout.registry.infomodel.ClassificationImpl@0, org.apache.ws.scout.registry.infomodel.ClassificationImpl@0]
| [java] - No PortType "ExampleService" found. Will be created.
| [java] - Port Type created. Key = uuid:2A13F120-666D-11DB-B120-D46FA9434EFD".
| [java] - creating Binding with portType key = uuid:2A13F120-666D-11DB-B120-D46FA9434EFD ...
| [java] - No Binding "ExampleServiceBinding" found. Will be created.
| [java] - Binding created. Key = uuid:2A1E9F80-666D-11DB-9F80-BE6A5FAB5552".
| [java] - creating Binding Template ...
| [java] - No Service Binding for access point "http://localhost:8080/example/ExampleService" found. Will be created.
| [java] - Service Binding for access point "http://localhost:8080/example/ExampleService" created. Key = 2A2F8F70-666D-11DB-8F70-DF53A4E0575C".
| [java] Done.
|
the server side is showing this error:
| 12:15:01,408 ERROR [SOAPFaultExceptionHelper] SOAP request exception
| javax.xml.rpc.soap.SOAPFaultException: Endpoint {http://org.jboss.example/ExampleService}ExampleServicePort does not contain operation meta data for: {http://schemas.xmlsoap.org/soap/envelope/}Envelope
| at org.jboss.ws.server.ServiceEndpointInvoker.getDispatchDestination(ServiceEndpointInvoker.java:175)
| at org.jboss.ws.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:110)
| at org.jboss.ws.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:234)
| at org.jboss.ws.server.ServiceEndpointServlet.doPost(ServiceEndpointServlet.java:120)
|
The example code is using JWSDP 1.5 for the WS generation/client invocation. I'm going to try JWSDP 1.6 & JBossWS and I'll tell you more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981517#3981517
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981517
19 years, 6 months