Report a bug in the editor and a question on subclassing a HibNode

16 views
Skip to first unread message

kreecha puphaiboon

unread,
Sep 16, 2011, 7:19:22 AM9/16/11
to sarasvati-wf-users, borirak...@scb.co.th
Dear Paul,

I want to report a bug. Here how it happened. I worked on nodes and
external process definition everything worked great. After closing the
editor program and re-open the editor. Then, i open the files that
related to many process definitions (external nodes/files) then i
double-click on the node to see properties but definition name in the
combo box has nothing. I have a captured picture of this but the forum
does not allow me to post T_T

Solution my team does is to select "save as" for all files. Then the
editor's combobox will see all process definition names as usual.
Every time we do, this wont be great i think in the long run.

One question to ask how can i extends HibNode. As i can save a class
that extends HibNode but when i want to load them from the database
using List<HibGraph> g = engine.getRepository().getGraphs(); then i
get the error "org.hibernate.wrong class exception object with id was
not of the specified subclass".

Could you tell us what we have done wrong e.g. Hibernate or
Configuration, please?

Your help will be greatly appreciated.

Regards,
Kreecha


----------------------------------------------------------------------------------------------------------------------------------------------------------------
package com.scb.core.workflow.node;

import com.googlecode.sarasvati.CustomNode;
import com.googlecode.sarasvati.Engine;
import com.googlecode.sarasvati.NodeToken;
import com.googlecode.sarasvati.hib.HibEngine;
import com.googlecode.sarasvati.hib.HibNode;
import com.scb.core.task.TaskState;
import com.scb.core.task.TaskUtil;
import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.SecondaryTable;

/**
*
* @author Earth
*/
@Entity
@DiscriminatorValue( "ILSNode" )
@SecondaryTable( name="wf_node_task",
pkJoinColumns=@PrimaryKeyJoinColumn(name="id"))
public class ILSNode extends HibNode
{

@Column(name = "name", table = "wf_node_task")
protected String taskName;
@Column(name = "description", table = "wf_node_task")
protected String taskDescription;

public ILSNode()
{
}

public String getTaskName()
{
return taskName;
}

public void setTaskName(final String taskName)
{
this.taskName = taskName;
}

public String getTaskDescription()
{
return taskDescription;
}

public void setTaskDescription(final String taskDesc)
{
this.taskDescription = taskDesc;
}

@Override
public void backtrack(final Engine engine, final NodeToken token)
{
TaskUtil.backtrackTask(engine, token);
}

@SuppressWarnings("unchecked")
@Override
public <T> T getAdaptor(final Class<T> clazz)
{
if (String.class == clazz)
{
return (T) getTaskName();
}
return super.getAdaptor(clazz);
}

@Override
public void execute(final Engine engine, final NodeToken token)
{
TaskUtil.createTask((HibEngine)engine, token,
token.getEnv().getAttribute("TYPE"), new
BigInteger(token.getEnv().getAttribute("APP_NO")), TaskState.Open);
}

}

Paul Lorenz

unread,
Sep 16, 2011, 4:07:52 PM9/16/11
to sarasvati...@googlegroups.com, borirak...@scb.co.th
I'll take a look at the editor bug and see if I can reproduce it. If you want to send the image to me directly at plo...@gmail.com, that would be helpful.

Node subtypes need to be registered with the engine:

http://sarasvati.googlecode.com/svn/java/tags/v1.0.4/doc/javadoc/com/googlecode/sarasvati/Engine.html#addNodeType(java.lang.String,%20java.lang.Class)

Engine#addNodeType only needs to be called once per VM, usually at startup.

cheers,
Paul


--
You received this message because you are subscribed to the Google Groups "sarasvati-wf-users" group.
To post to this group, send email to sarasvati...@googlegroups.com.
To unsubscribe from this group, send email to sarasvati-wf-us...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sarasvati-wf-users?hl=en.


Paul Lorenz

unread,
Sep 18, 2011, 2:30:16 PM9/18/11
to sarasvati...@googlegroups.com, borirak...@scb.co.th
I haven't been able to reproduce the editor bug. Can you give me step-by-step instructions on how you make it happen?

Thank you,
Paul

kreecha puphaiboon

unread,
Sep 19, 2011, 3:06:49 AM9/19/11
to sarasvati-wf-users
Hi Paul,

Thank you for your reply. I will give you tomorrow screen capture of
the process we made, but as my team is outside today and will be in
tomorrow. They actually revise the code to make it worked, so we will
give you two things tomorrow.

But i can not see your email address, can you send me an empty message
to my email: kreeecha....@scb.co.th. So i can send you the
images of how to create the bug please?

Thank you,
Kai

On Sep 19, 1:30 am, Paul Lorenz <plor...@gmail.com> wrote:
> I haven't been able to reproduce the editor bug. Can you give me
> step-by-step instructions on how you make it happen?
>
> Thank you,
> Paul
>
>
>
>
>
>
>
> On Fri, Sep 16, 2011 at 4:07 PM, Paul Lorenz <plor...@gmail.com> wrote:
> > I'll take a look at the editor bug and see if I can reproduce it. If you
> > want to send the image to me directly at plor...@gmail.com, that would be
> > helpful.
>
> > Node subtypes need to be registered with the engine:
>
> >http://sarasvati.googlecode.com/svn/java/tags/v1.0.4/doc/javadoc/com/...)<http://sarasvati.googlecode.com/svn/java/tags/v1.0.4/doc/javadoc/com/...>

Paul Lorenz

unread,
Sep 19, 2011, 10:29:32 PM9/19/11
to sarasvati...@googlegroups.com

Hi Kreecha,
   I got the image sent, but was still unable to reproduce the issue. If you could send step by step directions, that would be very helpful. Do you have a process definition library configured? If not, that will likely fix your issue. However, either way I'd like to make sure this bug gets fixed, as it should work even without a configured library.

Cheers,
Paul

kreecha puphaiboon

unread,
Sep 21, 2011, 8:26:02 PM9/21/11
to sarasvati-wf-users
Hi Paul,

I emailed you the steps and screens captured, did you receive?

May i ask about the license whether using Sarasvati is going to cost
anything?

Cheers,
Kai

On Sep 20, 9:29 am, Paul Lorenz <plor...@gmail.com> wrote:
> Hi Kreecha,
>    I got the image sent, but was still unable to reproduce the issue. If you
> could send step by step directions, that would be very helpful. Do you have
> a process definition library configured? If not, that will likely fix your
> issue. However, either way I'd like to make sure this bug gets fixed, as it
> should work even without a configured library.
>
> Cheers,
> Paul
> On Sep 19, 2011 3:06 AM, "kreecha puphaiboon" <kreecha.puphaib...@gmail.com>
> wrote:
>
>
>
>
>
>
>
> > Hi Paul,
>
> > Thank you for your reply. I will give you tomorrow screen capture of
> > the process we made, but as my team is outside today and will be in
> > tomorrow. They actually revise the code to make it worked, so we will
> > give you two things tomorrow.
>
> > But i can not see your email address, can you send me an empty message
> > to my email: kreeecha.puphaib...@scb.co.th. So i can send you the

Paul Lorenz

unread,
Sep 21, 2011, 10:24:30 PM9/21/11
to sarasvati...@googlegroups.com
Yes, I did. I was able to understand what the issue was and reproduce it. I have a fix and have released version 1.0.5 of the editor.

However, I would still really recommend that you use the Library feature of the editor. If you configure a library (Edit->Preferences, then look under General), it will find all your workflows whether or not you have them open already. You can then also use the Open Library feature, which can make finding a workflow easier (once you have a large number).

Sarasvati is licenced under the LGPLv3. There's a short synopsis here: http://code.google.com/p/sarasvati/wiki/LicenseFAQ

Basically, free to use and distribute, but if you distribute it, you must also provide the source (for Sarasvati, not your own code), and if you distribute modifications to Sarasvati you must distribute the source for the modifications as well. Does that make sense?

Cheers,
Paul

kreecha puphaiboon

unread,
Sep 22, 2011, 11:56:19 PM9/22/11
to sarasvati-wf-users
Yes it is clear Paul.

Thank you very much.

Kai
Reply all
Reply to author
Forward
0 new messages