Issue with importing and exporting the state definition

42 views
Skip to first unread message

vishal gaurav

unread,
Feb 11, 2015, 6:51:52 AM2/11/15
to squirrel-st...@googlegroups.com
Hi,

While trying to export the state definition I found that the actions are writtten using the below method :

private void writeAction(final Action<?, ?, ?, ?> action) {
        if(isExternalAction(action))
            writeLine("<sqrl:action content="+quoteName(action.toString())+"/>");
    }

Its is doing toString on the action object. In my case it generates following XML :

<sqrl:action content="com.mycomp.workflow.actions.WorkflowEditAction@7e4c974d"/>

Now when I am trying to import this back. In StateMachineImporterImpl.startElement() , It is looking for '#'

 else if(localName.equals("action") && uri.equals(SQRL_NAMESPACE)) {
            String actionContent = attributes.getValue("content");
            int pos = actionContent.indexOf("#");
            String actionSchema = actionContent.substring(0, pos);


Now since in my case there is no '#', I am getting IndexOutOfBound. 

Any suggestion ?

He Henry

unread,
Feb 11, 2015, 9:49:41 PM2/11/15
to squirrel-st...@googlegroups.com
Hi Vishal,

Dont be surprise this feature may have some bugs. I suggest your submit a issue on github with a runnable test case to reproduce your problem attached.

Thanks,
Henry

在 2015年2月11日星期三 UTC+8下午7:51:52,vishal gaurav写道:

vishal gaurav

unread,
Feb 12, 2015, 8:03:00 AM2/12/15
to squirrel-st...@googlegroups.com
Thanks Henry,

I am looking for persistence feature as well. I tried BPM Engine but they look fairly overkill. Now I will either use it or extend squirrel to be persistent along with data flow support. 

He Henry

unread,
Feb 12, 2015, 10:57:17 PM2/12/15
to squirrel-st...@googlegroups.com
Please feel free to submit a issue when you found something may not correct in your playing with squirrel. Just to know, it would be helpful if you submit a issue also with a runnable test which can reproduce the problem.

在 2015年2月12日星期四 UTC+8下午9:03:00,vishal gaurav写道:

vishal gaurav

unread,
Feb 13, 2015, 2:24:53 AM2/13/15
to squirrel-st...@googlegroups.com
I have raised an issue along with the quick test case.


On Wednesday, 11 February 2015 17:21:52 UTC+5:30, vishal gaurav wrote:

vishal gaurav

unread,
Feb 16, 2015, 1:11:44 PM2/16/15
to squirrel-st...@googlegroups.com
Thw workaround is make sure your toString implementation should be "instance#"+getClass().getName();


On Wednesday, 11 February 2015 17:21:52 UTC+5:30, vishal gaurav wrote:
Reply all
Reply to author
Forward
0 new messages