[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [bpel-dev] ExtensionActivity Deserializer problem
|
Hi Tobias,
Thank you very much for your help and remarks. I will fix those mistakes
HTDeserializer.But I cant find the mistake in
PeopleActivityRTImpl. I have implemented the method
PeopleActivityRTImpl.basicSetRemoteTask as follows. I have attached the original code to.
/** * <!-- begin-user-doc -->
* <!-- end-user-doc --> * @generated NOT
*/ public NotificationChain basicSetRemoteTask(RemoteTask newRemoteTask, NotificationChain msgs) {
RemoteTask oldRemoteTask = remoteTask; if (!isReconciling) {
ReconciliationHelper.replaceChild(this, oldRemoteTask, newRemoteTask); }
remoteTask = newRemoteTask; if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ModelPackage.PEOPLE_ACTIVITY_RT__REMOTE_TASK, oldRemoteTask, newRemoteTask);
if (msgs == null) msgs = notification; else msgs.add(notification); }
return msgs; }
Could you help me to figure out the error.
Thanks & Kind Regards.
On Tue, Jul 19, 2011 at 1:45 PM, Tobias Liefke
<tobias.liefke@xxxxxxxxxxxxx> wrote:
I will try to answer instead of Bob.
The problem is not your Serializer/Deserializer, but your implementation of ExtensionActivity (PeopleActivityRTImpl?). Without knowing that class
I can only guess, that you are using
this.getElement() in
PeopleActivityRTImpl.basicSetRemoteTask(RemoteTask rt) to add the the element of the
remote task. This will add the RemoteTask element to the <bpel:extensionActivity> element, as this is the one which is connected to
an implementation of ExtensionActivity.
Finally some remarks on HTDeserializer:
- A serializer/deserializer must be stateless (your instance variables may lead to unexpected side effects).
- XML is case sensitive. Don't use equalsIgnoreCase when comparing the element name.
- Why are you iterating twice over the list of child nodes?
Tobias
Hi Bob,
I am trying to implement an extensionActivity . This activity generates following XML code.
<bpel:extensionActivity>
<b4p:peopleActivity name="PeopleActivityRT">
<b4p:remoteTask></b4p:remoteTask>
</b4p:peopleActivity>
</bpel:extensionActivity>
But I have found an error when I open a saved bpel file using business process editor. When I open a bpel file using business process editor, it changes like this,
<bpel:extensionActivity>
<b4p:peopleActivity name="PeopleActivityRT">
</b4p:peopleActivity>
<b4p:remoteTask></b4p:remoteTask>
</bpel:extensionActivity>
This is not happened when I open a file using XML editor. So I thing it is a problem of Deserilizer of the extensionActivity. Any Idea about what went wrong ?.
I have attached Deserializer and Serializer classes.
--
Hasitha Aravinda,
Undergraduate,
Department of Computer Science and Engineering,
University of Moratuwa,
Sri Lanka.
My web portal :
http://hasitha.comze.com
_______________________________________________
bpel-dev mailing list
bpel-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/bpel-dev
--
Hasitha Aravinda,
Undergraduate,
Department of Computer Science and Engineering,
University of Moratuwa,
Sri Lanka.
My web portal : http://hasitha.comze.com
import org.eclipse.bpel.model.FromParts;
import org.eclipse.bpel.model.ToParts;
import org.eclipse.bpel.model.Variable;
import org.eclipse.bpel.model.impl.ExtensionActivityImpl;
import org.eclipse.bpel.model.util.BPELUtils;
import org.eclipse.bpel.model.util.ReconciliationHelper;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.wso2.bpel.humantask.model.ModelPackage;
import org.wso2.bpel.humantask.model.PeopleActivityRT;
import org.wso2.bpel.humantask.model.RemoteTask;
import org.wso2.bpel.humantask.model.ModelPackage;
import org.wso2.bpel.humantask.model.util.HTConstants;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>People Activity RT</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.wso2.bpel.humantask.model.impl.PeopleActivityRTImpl#getInputVariable <em>Input Variable</em>}</li>
* <li>{@link org.wso2.bpel.humantask.model.impl.PeopleActivityRTImpl#getOutputVariable <em>Output Variable</em>}</li>
* <li>{@link org.wso2.bpel.humantask.model.impl.PeopleActivityRTImpl#isIsSkipable <em>Is Skipable</em>}</li>
* <li>{@link org.wso2.bpel.humantask.model.impl.PeopleActivityRTImpl#isDontShareComments <em>Dont Share Comments</em>}</li>
* <li>{@link org.wso2.bpel.humantask.model.impl.PeopleActivityRTImpl#getRemoteTask <em>Remote Task</em>}</li>
* <li>{@link org.wso2.bpel.humantask.model.impl.PeopleActivityRTImpl#getToParts <em>To Parts</em>}</li>
* <li>{@link org.wso2.bpel.humantask.model.impl.PeopleActivityRTImpl#getFromParts <em>From Parts</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class PeopleActivityRTImpl extends ExtensionActivityImpl implements PeopleActivityRT {
/**
* The cached value of the '{@link #getInputVariable() <em>Input Variable</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInputVariable()
* @generated
* @ordered
*/
protected Variable inputVariable;
/**
* The cached value of the '{@link #getOutputVariable() <em>Output Variable</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOutputVariable()
* @generated
* @ordered
*/
protected Variable outputVariable;
/**
* The default value of the '{@link #isIsSkipable() <em>Is Skipable</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isIsSkipable()
* @generated
* @ordered
*/
protected static final boolean IS_SKIPABLE_EDEFAULT = false;
/**
* The cached value of the '{@link #isIsSkipable() <em>Is Skipable</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isIsSkipable()
* @generated
* @ordered
*/
protected boolean isSkipable = IS_SKIPABLE_EDEFAULT;
/**
* The default value of the '{@link #isDontShareComments() <em>Dont Share Comments</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isDontShareComments()
* @generated
* @ordered
*/
protected static final boolean DONT_SHARE_COMMENTS_EDEFAULT = false;
/**
* The cached value of the '{@link #isDontShareComments() <em>Dont Share Comments</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isDontShareComments()
* @generated
* @ordered
*/
protected boolean dontShareComments = DONT_SHARE_COMMENTS_EDEFAULT;
/**
* The cached value of the '{@link #getRemoteTask() <em>Remote Task</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRemoteTask()
* @generated
* @ordered
*/
protected RemoteTask remoteTask;
/**
* The cached value of the '{@link #getToParts() <em>To Parts</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getToParts()
* @generated
* @ordered
*/
protected ToParts toParts;
/**
* The cached value of the '{@link #getFromParts() <em>From Parts</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFromParts()
* @generated
* @ordered
*/
protected FromParts fromParts;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected PeopleActivityRTImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ModelPackage.Literals.PEOPLE_ACTIVITY_RT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Variable getInputVariable() {
if (inputVariable != null && inputVariable.eIsProxy()) {
InternalEObject oldInputVariable = (InternalEObject)inputVariable;
inputVariable = (Variable)eResolveProxy(oldInputVariable);
if (inputVariable != oldInputVariable) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ModelPackage.PEOPLE_ACTIVITY_RT__INPUT_VARIABLE, oldInputVariable, inputVariable));
}
}
return inputVariable;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Variable basicGetInputVariable() {
return inputVariable;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
public void setInputVariable(Variable newInputVariable) {
Variable oldInputVariable = inputVariable;
if (!isReconciling) {
ReconciliationHelper.replaceAttribute(
this,
HTConstants.AT_INPUT_VARIABLE,
newInputVariable == null ? null : newInputVariable
.getName());
}
inputVariable = newInputVariable;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.PEOPLE_ACTIVITY_RT__INPUT_VARIABLE, oldInputVariable, inputVariable));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Variable getOutputVariable() {
if (outputVariable != null && outputVariable.eIsProxy()) {
InternalEObject oldOutputVariable = (InternalEObject)outputVariable;
outputVariable = (Variable)eResolveProxy(oldOutputVariable);
if (outputVariable != oldOutputVariable) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ModelPackage.PEOPLE_ACTIVITY_RT__OUTPUT_VARIABLE, oldOutputVariable, outputVariable));
}
}
return outputVariable;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Variable basicGetOutputVariable() {
return outputVariable;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
public void setOutputVariable(Variable newOutputVariable) {
Variable oldOutputVariable = outputVariable;
if (!isReconciling) {
ReconciliationHelper.replaceAttribute(
this,
HTConstants.AT_OUTPUT_VARIABLE,
newOutputVariable == null ? null : newOutputVariable
.getName());
}
outputVariable = newOutputVariable;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.PEOPLE_ACTIVITY_RT__OUTPUT_VARIABLE, oldOutputVariable, outputVariable));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isIsSkipable() {
return isSkipable;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
public void setIsSkipable(boolean newIsSkipable) {
boolean oldIsSkipable = isSkipable;
if (!isReconciling) {
ReconciliationHelper.replaceAttribute(this,
HTConstants.AT_IS_SKIPABLE,
BPELUtils.boolean2XML(newIsSkipable));
}
isSkipable = newIsSkipable;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.PEOPLE_ACTIVITY_RT__IS_SKIPABLE, oldIsSkipable, isSkipable));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isDontShareComments() {
return dontShareComments;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
public void setDontShareComments(boolean newDontShareComments) {
boolean oldDontShareComments = dontShareComments;
if (!isReconciling) {
ReconciliationHelper.replaceAttribute(this,
HTConstants.AT_DO_NT_SHARE_COMMENTS,
BPELUtils.boolean2XML(newDontShareComments));
}
dontShareComments = newDontShareComments;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.PEOPLE_ACTIVITY_RT__DONT_SHARE_COMMENTS, oldDontShareComments, dontShareComments));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public RemoteTask getRemoteTask() {
return remoteTask;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
public NotificationChain basicSetRemoteTask(RemoteTask newRemoteTask, NotificationChain msgs) {
RemoteTask oldRemoteTask = remoteTask;
if (!isReconciling) {
ReconciliationHelper.replaceChild(this, oldRemoteTask, newRemoteTask);
}
remoteTask = newRemoteTask;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ModelPackage.PEOPLE_ACTIVITY_RT__REMOTE_TASK, oldRemoteTask, newRemoteTask);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRemoteTask(RemoteTask newRemoteTask) {
if (newRemoteTask != remoteTask) {
NotificationChain msgs = null;
if (remoteTask != null)
msgs = ((InternalEObject)remoteTask).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ModelPackage.PEOPLE_ACTIVITY_RT__REMOTE_TASK, null, msgs);
if (newRemoteTask != null)
msgs = ((InternalEObject)newRemoteTask).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ModelPackage.PEOPLE_ACTIVITY_RT__REMOTE_TASK, null, msgs);
msgs = basicSetRemoteTask(newRemoteTask, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.PEOPLE_ACTIVITY_RT__REMOTE_TASK, newRemoteTask, newRemoteTask));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ToParts getToParts() {
if (toParts != null && toParts.eIsProxy()) {
InternalEObject oldToParts = (InternalEObject)toParts;
toParts = (ToParts)eResolveProxy(oldToParts);
if (toParts != oldToParts) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ModelPackage.PEOPLE_ACTIVITY_RT__TO_PARTS, oldToParts, toParts));
}
}
return toParts;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ToParts basicGetToParts() {
return toParts;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
public void setToParts(ToParts newToParts) {
ToParts oldToParts = toParts;
if (!isReconciling) {
ReconciliationHelper.replaceChild(this, oldToParts, newToParts);
}
toParts = newToParts;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.PEOPLE_ACTIVITY_RT__TO_PARTS, oldToParts, toParts));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FromParts getFromParts() {
if (fromParts != null && fromParts.eIsProxy()) {
InternalEObject oldFromParts = (InternalEObject)fromParts;
fromParts = (FromParts)eResolveProxy(oldFromParts);
if (fromParts != oldFromParts) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ModelPackage.PEOPLE_ACTIVITY_RT__FROM_PARTS, oldFromParts, fromParts));
}
}
return fromParts;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FromParts basicGetFromParts() {
return fromParts;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
public void setFromParts(FromParts newFromParts) {
FromParts oldFromParts = fromParts;
if (!isReconciling) {
ReconciliationHelper.replaceChild(this, oldFromParts, newFromParts);
}
fromParts = newFromParts;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.PEOPLE_ACTIVITY_RT__FROM_PARTS, oldFromParts, fromParts));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ModelPackage.PEOPLE_ACTIVITY_RT__REMOTE_TASK:
return basicSetRemoteTask(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ModelPackage.PEOPLE_ACTIVITY_RT__INPUT_VARIABLE:
if (resolve) return getInputVariable();
return basicGetInputVariable();
case ModelPackage.PEOPLE_ACTIVITY_RT__OUTPUT_VARIABLE:
if (resolve) return getOutputVariable();
return basicGetOutputVariable();
case ModelPackage.PEOPLE_ACTIVITY_RT__IS_SKIPABLE:
return isIsSkipable();
case ModelPackage.PEOPLE_ACTIVITY_RT__DONT_SHARE_COMMENTS:
return isDontShareComments();
case ModelPackage.PEOPLE_ACTIVITY_RT__REMOTE_TASK:
return getRemoteTask();
case ModelPackage.PEOPLE_ACTIVITY_RT__TO_PARTS:
if (resolve) return getToParts();
return basicGetToParts();
case ModelPackage.PEOPLE_ACTIVITY_RT__FROM_PARTS:
if (resolve) return getFromParts();
return basicGetFromParts();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ModelPackage.PEOPLE_ACTIVITY_RT__INPUT_VARIABLE:
setInputVariable((Variable)newValue);
return;
case ModelPackage.PEOPLE_ACTIVITY_RT__OUTPUT_VARIABLE:
setOutputVariable((Variable)newValue);
return;
case ModelPackage.PEOPLE_ACTIVITY_RT__IS_SKIPABLE:
setIsSkipable((Boolean)newValue);
return;
case ModelPackage.PEOPLE_ACTIVITY_RT__DONT_SHARE_COMMENTS:
setDontShareComments((Boolean)newValue);
return;
case ModelPackage.PEOPLE_ACTIVITY_RT__REMOTE_TASK:
setRemoteTask((RemoteTask)newValue);
return;
case ModelPackage.PEOPLE_ACTIVITY_RT__TO_PARTS:
setToParts((ToParts)newValue);
return;
case ModelPackage.PEOPLE_ACTIVITY_RT__FROM_PARTS:
setFromParts((FromParts)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ModelPackage.PEOPLE_ACTIVITY_RT__INPUT_VARIABLE:
setInputVariable((Variable)null);
return;
case ModelPackage.PEOPLE_ACTIVITY_RT__OUTPUT_VARIABLE:
setOutputVariable((Variable)null);
return;
case ModelPackage.PEOPLE_ACTIVITY_RT__IS_SKIPABLE:
setIsSkipable(IS_SKIPABLE_EDEFAULT);
return;
case ModelPackage.PEOPLE_ACTIVITY_RT__DONT_SHARE_COMMENTS:
setDontShareComments(DONT_SHARE_COMMENTS_EDEFAULT);
return;
case ModelPackage.PEOPLE_ACTIVITY_RT__REMOTE_TASK:
setRemoteTask((RemoteTask)null);
return;
case ModelPackage.PEOPLE_ACTIVITY_RT__TO_PARTS:
setToParts((ToParts)null);
return;
case ModelPackage.PEOPLE_ACTIVITY_RT__FROM_PARTS:
setFromParts((FromParts)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ModelPackage.PEOPLE_ACTIVITY_RT__INPUT_VARIABLE:
return inputVariable != null;
case ModelPackage.PEOPLE_ACTIVITY_RT__OUTPUT_VARIABLE:
return outputVariable != null;
case ModelPackage.PEOPLE_ACTIVITY_RT__IS_SKIPABLE:
return isSkipable != IS_SKIPABLE_EDEFAULT;
case ModelPackage.PEOPLE_ACTIVITY_RT__DONT_SHARE_COMMENTS:
return dontShareComments != DONT_SHARE_COMMENTS_EDEFAULT;
case ModelPackage.PEOPLE_ACTIVITY_RT__REMOTE_TASK:
return remoteTask != null;
case ModelPackage.PEOPLE_ACTIVITY_RT__TO_PARTS:
return toParts != null;
case ModelPackage.PEOPLE_ACTIVITY_RT__FROM_PARTS:
return fromParts != null;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (isSkipable: ");
result.append(isSkipable);
result.append(", dontShareComments: ");
result.append(dontShareComments);
result.append(')');
return result.toString();
}
} //PeopleActivityRTImpl