-
1. Re: Business process variables duplicted when updated.
gavin.king Jun 16, 2007 4:05 PM (in response to aggtecnologia)That is all totally expected behavior.
A String doesn't have an implicit BUSINESS_PROCESS scope, you need to specify that explicitly.
And Seam tasks are atomic - they do not modify the process instance variables until the task completes successfully, at which time the task instance variables are copied back to the process instance. This is a Really Nice Thing. -
2. Re: Business process variables duplicted when updated.
aggtecnologia Jun 16, 2007 6:09 PM (in response to aggtecnologia)Thank you Gavin for your PROMPT (yes in capitals :-) ) response.
I would like to verify if I am interpreting the right way what´s going on. Here is a snippet from my code:
@Stateful
@Name("verifyData")
public class verificarDatosBean implements verificarDatos {
@In
@Out(scope=ScopeType.BUSINESS_PROCESS, required=false)
@EndTask
public String saveModifiedData() {
return "/home.seam";
}
@Remove @Destroy public void destroy(){}
public String getUnDato() {
return unDato;
}
public void setUnDato(String unDato) {
this.unDato = unDato;
}
}
1. When seam finds:
@In
private String unDato;
injects the the BUSSINESS_PROCESS variable unDato. (The variable was already created elsewere with BUSSINESS_PROCESS scope AND I already called a method annotated with @StartTask, so I am inside a BUSSINESS_PROCESS)
2. As soon as any method inside the object is executed (I think in my case it is the getter because this EJB is acting as a Backing Bean) Seams finds:
private String unDato;
@Out(scope=ScopeType.BUSINESS_PROCESS, required=false)
and creates the new variable with the same name (unDato) and scope (unDato) but with different Id.
3. When I execute:
@EndTask
public String saveModifiedData()
Seam sees that the task is completed and updates the original variable.
Forgive my verbosity but I want to be sure I am conceptually right. (So I learn once for good)
Claudio