[kepler-users] saving workflow from actor code

Ufuk Utku Turuncoglu turuncu at ucar.edu
Mon Jun 22 10:53:54 PDT 2009


When i tried to implement your suggestion, i got following error during 
opening workflow. The actor CCSMConfig2 dir port is connected to diamond 
and it causes error. The workflow is opened without error when i comment 
this part of the code. Any suggestion?

ps: line 442 has effigy.setModified(true); definition.

Thanks,

--ufuk

link CCSMConfig2.dir to relation
null
null

java.lang.NullPointerException
    at 
org.earth.actors.model.CCSMConfig.connectionsChanged(CCSMConfig.java:442)
    at ptolemy.kernel.ComponentPort._doLink(ComponentPort.java:1138)
    at ptolemy.kernel.ComponentPort.link(ComponentPort.java:543)
    at ptolemy.actor.IOPort.link(IOPort.java:2457)
    at ptolemy.moml.MoMLParser._processLink(MoMLParser.java:5969)
    at ptolemy.moml.MoMLParser.access$700(MoMLParser.java:204)
    at ptolemy.moml.MoMLParser$LinkRequest.execute(MoMLParser.java:7000)
    at ptolemy.moml.MoMLParser._processPendingRequests(MoMLParser.java:6103)
    at ptolemy.moml.MoMLParser.endElement(MoMLParser.java:921)
    at com.microstar.xml.XmlParser.parseETag(XmlParser.java:1026)
    at com.microstar.xml.XmlParser.parseContent(XmlParser.java:1098)
    at com.microstar.xml.XmlParser.parseElement(XmlParser.java:924)
    at com.microstar.xml.XmlParser.parseContent(XmlParser.java:1104)
    at com.microstar.xml.XmlParser.parseElement(XmlParser.java:924)
    at com.microstar.xml.XmlParser.parseDocument(XmlParser.java:481)
    at com.microstar.xml.XmlParser.doParse(XmlParser.java:159)
    at com.microstar.xml.XmlParser.parse(XmlParser.java:132)
    at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1410)
    at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1347)
    at ptolemy.moml.MoMLParser.parse(MoMLParser.java:1298)
    at 
ptolemy.actor.gui.PtolemyEffigy$Factory.createEffigy(PtolemyEffigy.java:417)
    at ptolemy.actor.gui.EffigyFactory.createEffigy(EffigyFactory.java:215)
    at ptolemy.actor.gui.Configuration.openModel(Configuration.java:666)
    at ptolemy.actor.gui.Configuration.openModel(Configuration.java:626)
    at ptolemy.actor.gui.TableauFrame._read(TableauFrame.java:941)
    at ptolemy.gui.Top._open(Top.java:751)
    at ptolemy.gui.Top$FileMenuListener.actionPerformed(Top.java:1139)
    at org.kepler.gui.MenuMapper$1.actionPerformed(MenuMapper.java:343)
    at 
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
    at 
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
    at 
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    at 
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:389)
    at 
javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1225)
    at com.apple.laf.AquaMenuItemUI.doClick(AquaMenuItemUI.java:120)
    at 
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1266)
    at java.awt.Component.processMouseEvent(Component.java:6301)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
    at java.awt.Component.processEvent(Component.java:6066)
    at java.awt.Container.processEvent(Container.java:2085)
    at java.awt.Component.dispatchEventImpl(Component.java:4667)
    at java.awt.Container.dispatchEventImpl(Container.java:2143)
    at java.awt.Component.dispatchEvent(Component.java:4497)
    at 
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4600)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4264)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4194)
    at java.awt.Container.dispatchEventImpl(Container.java:2129)
    at java.awt.Window.dispatchEventImpl(Window.java:2475)
    at java.awt.Component.dispatchEvent(Component.java:4497)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:635)
    at 
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    at 
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    at 
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)


Christopher Brooks wrote:
> Try something like:
>
> import ptolemy.actor.gui.Configuration;
> import ptolemy.actor.gui.Effigy;
> ...
>  Effigy effigy = Configuration.findEffigy(model.toplevel());
>  effigy.setModified(true);
> ...
>
> _Christopher
>
> Ufuk Utku Turuncoglu wrote:
>> Hi,
>>
>> Thanks for your suggestion. Is it necessary to create 
>> MoMLChangeRequest for this purpose? Is there any example of it?
>>
>> Thanks,
>>
>> --ufuk
>>
>> Edward A. Lee wrote:
>>>
>>> Are you sure you want to do that? Saving a workflow without the user's
>>> intervention seems dangerous.
>>>
>>> An alternative is to just mark the model modified so that when it is 
>>> closed,
>>> the user is prompted about whether to save.
>>>
>>> Edward
>>>
>>>
>>> Ufuk Utku Turuncoglu wrote:
>>>> Hi,
>>>>
>>>> Is there any way to save the workflow from actor code? My custom 
>>>> actor changes its parameter value and i need the save the workflow 
>>>> when parameter field changes.
>>>>
>>>> Thanks,
>>>>
>>>> --ufuk
>>>> _______________________________________________
>>>> Kepler-users mailing list
>>>> Kepler-users at kepler-project.org
>>>> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users
>>
>> _______________________________________________
>> Kepler-users mailing list
>> Kepler-users at kepler-project.org
>> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users
>


Christopher Brooks wrote:
> Try something like:
>
> import ptolemy.actor.gui.Configuration;
> import ptolemy.actor.gui.Effigy;
> ...
>  Effigy effigy = Configuration.findEffigy(model.toplevel());
>  effigy.setModified(true);
> ...
>
> _Christopher
>
> Ufuk Utku Turuncoglu wrote:
>> Hi,
>>
>> Thanks for your suggestion. Is it necessary to create 
>> MoMLChangeRequest for this purpose? Is there any example of it?
>>
>> Thanks,
>>
>> --ufuk
>>
>> Edward A. Lee wrote:
>>>
>>> Are you sure you want to do that? Saving a workflow without the user's
>>> intervention seems dangerous.
>>>
>>> An alternative is to just mark the model modified so that when it is 
>>> closed,
>>> the user is prompted about whether to save.
>>>
>>> Edward
>>>
>>>
>>> Ufuk Utku Turuncoglu wrote:
>>>> Hi,
>>>>
>>>> Is there any way to save the workflow from actor code? My custom 
>>>> actor changes its parameter value and i need the save the workflow 
>>>> when parameter field changes.
>>>>
>>>> Thanks,
>>>>
>>>> --ufuk
>>>> _______________________________________________
>>>> Kepler-users mailing list
>>>> Kepler-users at kepler-project.org
>>>> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users
>>
>> _______________________________________________
>> Kepler-users mailing list
>> Kepler-users at kepler-project.org
>> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users
>




More information about the Kepler-users mailing list