[JBoss jBPM] - Re: Assign-copy problem, very strange!
by alex.guizar@jboss.com
anonymous wrote : How can I produce "fictive" copy?
|
| That means, if I really want to copy only into 2-d parameter, how
| can I "simulate" copy into 1-st parameter and really leave it untouched?
Well, the real problem is, according to your schema, the description element must be present:
<element name="description" nillable="true" type="string"/>
| <element name="id" nillable="true" type="string"/>
nillable="true" means that the attribute xsi:nil may appear in the element, indicating that its value should be considered null. It does not mean that the element is optional. The following code gives the desired effect:
<assign>
| <copy>
| <from expression="'true'" />
| <to variable="_createOrderMessage" part="root" query="/root/impl3:customerRoot/impl4:description/@xsi:nil"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
| </copy>
| <copy>
| <from variable="_start" part="ID"/>
| <to variable="_createOrderMessage" part="root" query="/root/impl3:customerRoot/impl4:id"/>
| </copy>
| </assign>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3998019#3998019
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3998019
19 years, 3 months
[EJB 3.0] - Re: ORM.xml Sample
by david.l.small
Thanks for the follow-up, Wolfgang. Actually, I tried multiple options. First I completely excluded the entity elements. Then, I explicitly set the metadata-complete to false. When I looked further I discovered that the error wasn't explicitly with the EAR that contained the ORM.xml file. My other projects (different EARs) with their own EJB projects were failing to start with errors pointing back to the single query in my ORM.xml.
As it turns out if, my other EJB projects were picking up the ORM.xml in the first project. The fix: put an empy ORM.xml file in the other EJB projects. I was running for the longest time without any ORM.xml files in any of my projects and having no problems. Once I included an ORM.xml file in one of my projects, all the other ones that tried to start after that project failed unless they contained an empty ORM.xml file. It seems a bit odd, but it now works.
I hope this makes sense.
The upshot is that you can have an ORM.xml with no "entity" elements and only queries and it seems to work just fine.
Thanks for your help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3998016#3998016
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3998016
19 years, 3 months
[JBoss Seam] - interceptor in ejb-jar.xml doesn't works
by juangiovanolli
Hi:
i created a new interceptor and i add it in ejb-jar.xml. this interceptor is a global interceptor, as you can see in my ejb-jar.xml shown below.
The problem is that the interceptor is never reached, That is, the workflowinterceptor is never loaded.
Any ideas???
| <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
| version="3.0">
|
|
| <interceptors>
| <interceptor>
| <interceptor-class>
| org.jboss.seam.ejb.SeamInterceptor
| </interceptor-class>
| </interceptor>
| <interceptor>
| <interceptor-class>
| com.santex.darwin.service.interceptor.WorkflowInterceptor
| </interceptor-class>
| </interceptor>
|
| </interceptors>
|
|
| <assembly-descriptor>
| <interceptor-binding>
| <ejb-name>*</ejb-name>
| <interceptor-class>
| org.jboss.seam.ejb.SeamInterceptor
| </interceptor-class>
| <interceptor-class>
| com.santex.darwin.service.interceptor.WorkflowInterceptor
| </interceptor-class>
| </interceptor-binding>
| </assembly-descriptor>
|
|
| </ejb-jar>
|
my workflowInterceptor is:
| package com.santex.darwin.service.interceptor;
|
| import javax.interceptor.AroundInvoke;
| import javax.interceptor.InvocationContext;
|
| import org.jboss.seam.contexts.Contexts;
|
| /**
| *
| * @author Juan Giovanolli
| * 29/12/2006
| */
| public class WorkflowInterceptor
| {
| @AroundInvoke
| public Object manageWorkflowRuntime(final InvocationContext invocation) throws Exception {
|
| if (invocation.getMethod().isAnnotationPresent(StartActivity.class)) {
| System.out.println("tiene el start");
| }
| if (invocation.getMethod().isAnnotationPresent(EndActivity.class)) {
| System.out.println("tiene el end");
| }
|
| return invocation.proceed();
| }
| }
|
|
and my startActivity and endactivity annotations are
| /**
| *
| */
| package com.santex.darwin.service.interceptor;
|
| import java.lang.annotation.ElementType;
| import java.lang.annotation.Retention;
| import java.lang.annotation.RetentionPolicy;
| import java.lang.annotation.Target;
|
| import javax.interceptor.Interceptors;
|
| /**
| * @author Juan Giovanolli
| * 02/01/2007
| */
| @Target(ElementType.METHOD)
| @Retention(RetentionPolicy.RUNTIME)
|
| //(a)Interceptors(WorkflowInterceptor.class)
| public @interface StartActivity
| {
|
| }
|
|
| /**
| *
| */
| package com.santex.darwin.service.interceptor;
|
| import java.lang.annotation.ElementType;
| import java.lang.annotation.Retention;
| import java.lang.annotation.RetentionPolicy;
| import java.lang.annotation.Target;
|
| import javax.interceptor.Interceptors;
|
| /**
| * @author Juan Giovanolli
| * 02/01/2007
| */
| @Target(ElementType.METHOD)
| @Retention(RetentionPolicy.RUNTIME)
|
| //(a)Interceptors(WorkflowInterceptor.class)
| public @interface EndActivity
| {
|
| }
|
|
the class where i testing this is this:
| package com.santex.darwin.example;
|
| import javax.ejb.Remove;
| import javax.interceptor.Interceptors;
|
| import org.jboss.seam.ScopeType;
| import org.jboss.seam.annotations.CreateProcess;
| import org.jboss.seam.annotations.Destroy;
| import org.jboss.seam.annotations.EndTask;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Out;
| import org.jboss.seam.annotations.StartTask;
| import org.jboss.seam.core.TaskInstance;
| import org.jboss.seam.ejb.SeamInterceptor;
|
| import com.santex.darwin.core.workflow.Task;
| import com.santex.darwin.service.core.workflow.WorkflowManager;
| import com.santex.darwin.service.interceptor.EndActivity;
| import com.santex.darwin.service.interceptor.StartActivity;
| import com.santex.darwin.service.interceptor.WorkflowActivity;
| import com.santex.darwin.service.interceptor.WorkflowInterceptor;
|
| /**
| *
| * @author Juan Giovanolli 29/11/2006
| */
|
| @Name("taskManager")
| //@WorkflowActivity
| //(a)Interceptors(WorkflowInterceptor.class)
| public class TaskBeanExample implements Task
| {
|
| private String description;
|
| @In(create = true)
| WorkflowManager workflowManager;
|
| @Out(scope = ScopeType.BUSINESS_PROCESS)
| private String a = "S S";
|
| @In(create = true, required = false)
| org.jbpm.taskmgmt.exe.TaskInstance taskInstance;
|
| public String getA()
| {
| return a;
| }
|
| public void setA(String a)
| {
| this.a = a;
| }
|
|
|
| /**
| * @return the description
| */
| public String getDescription()
| {
| return description;
| }
|
| /**
| * @param description
| * the description to set
| */
| public void setDescription(String pDescription)
| {
| this.description = pDescription;
| }
|
| @StartTask
| @StartActivity
| public String startTask()
| {
| // System.out.println(workflowManagerImpl.getPendingTasks("sdfg"));
| System.out.println("ddddddddddddddddddddddddddddddddd" + a);
| a = ">>>>>VAR IN START<<<<<";
| try {
| System.out.println(">>>>>>>>>>startTask1" + taskInstance.getId() + " VARIABLES: "
| + taskInstance.getVariables().toString());
| taskInstance.setVariable("a1", a);
| System.out.println(">>>>>>>>>>startTask2" + taskInstance.getId() + " VARIABLES: "
| + taskInstance.getVariables().toString());
| }
| catch (Exception e) {
| e.printStackTrace();
| }
| return "";
| }
|
| @EndTask
| @EndActivity
| public String endTask()
| {
| System.out.println("ddddddddddddddddddddddddddddddddd" + a);
| a = ">>>>>VAR IN END<<<<<";
| try {
| System.out.println(">>>>>>>>>>endTask1" + taskInstance.getId() + " VARIABLES: "
| + taskInstance.getVariables().toString());
|
| taskInstance.setVariable("a2", a);
| System.out.println(">>>>>>>>>>endTask2" + taskInstance.getId() + " VARIABLES: "
| + taskInstance.getVariables().toString());
|
| }
| catch (Exception e) {
| e.printStackTrace();
| }
| return "";
| }
|
| @Remove
| @Destroy
| public void destroy()
| {
|
| }
|
| @CreateProcess(definition = "ProcessAbstract")
| public String startProcess()
| {
| return "";
| }
|
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3998009#3998009
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3998009
19 years, 3 months