[jboss-jira] [JBoss JIRA] Commented: (GPD-77) Need a way to initialize palette objects in GD 3.1

John Ruud (JIRA) jira-events at lists.jboss.org
Fri Aug 3 16:45:03 EDT 2007


    [ http://jira.jboss.com/jira/browse/GPD-77?page=comments#action_12371105 ] 
            
John Ruud commented on GPD-77:
------------------------------

Koen,

Moving the initialize() call to SemanticElementFactory doesn't seem to work for me, for the following reason:

While initialize() is correctly being invoked when dropping something from my palettte:

Decide(AbstractDecide).initialize() line: 21	
SemanticElementFactory.createById(String) line: 30	
CreationFactory.getNewObject() line: 34	
CreateRequest.getNewObject() line: 73
...

it is also invoked as part of reading the diagram (which is not good as it will reset properties that potentially have been modified):

Decide(AbstractDecide).initialize() line: 21	
SemanticElementFactory.createById(String) line: 30	
ProcessDefinitionDomAdapter(XmlAdapter).createSemanticElementFor(XmlAdapter) line: 476	
ProcessDefinitionDomAdapter.doModelAdd(XmlAdapter) line: 157	
ProcessDefinitionDomAdapter(XmlAdapter).initialize(SemanticElement) line: 462	
ProcessDefinitionDomAdapter.initialize(SemanticElement) line: 94	
XpdlEditor(Editor).getSemanticElement(StructuredTextEditor) line: 163	
XpdlEditor(Editor).initSourcePage() line: 145	
XpdlEditor(Editor).createPages() line: 84	
XpdlEditor(JpdlEditor).createPages() line: 134	
XpdlEditor(MultiPageEditorPart).createPartControl(Composite) line: 276	
EditorReference.createPartHelper() line: 596	
EditorReference.createPart() line: 372
...

Invoking initialize() (or possibly named: initializeNew/initializeFromPalette etc.) in org.jbpm.gd.common.editor.CreationFactory DOES work, as it will not get invoked when reading the diagram:

public Object getNewObject() {
		String notationElementId = NotationMapping.getNotationElementId(elementId);
		NotationElement notationElement = notationElementFactory.create(notationElementId);
		if (notationElement instanceof Node) {
			Dimension dimension = NotationMapping.getInitialDimension(elementId);
			if (dimension != null) {
				Rectangle constraint = ((Node)notationElement).getConstraint();
				constraint.setSize(new Dimension(dimension));
			}
		}
		SemanticElement jpdlElement = semanticElementFactory.createById(elementId);
		jpdlElement.initializeNew(); // I added my code here...
		notationElement.setSemanticElement(jpdlElement);
		return notationElement;
	}

Please let me know if you need more info!

John

> Need a way to initialize palette objects in GD 3.1
> --------------------------------------------------
>
>                 Key: GPD-77
>                 URL: http://jira.jboss.com/jira/browse/GPD-77
>             Project: JBoss jBPM GPD
>          Issue Type: Feature Request
>          Components: jpdl
>    Affects Versions: jBPM JPDL Designer 3.1.0.alpha4
>            Reporter: John Ruud
>         Assigned To: Koen Aers
>             Fix For: jBPM JPDL Designer 3.1.0.beta2
>
>         Attachments: GPD-77.patch
>
>
> For example, whenever an 'EndState' node is added to the diagram, I need for it to be initialized with a particular event, action, and some action properties. I have made some minor changes to the GD code in order to support this, as described in the following post: http://www.jboss.org/index.html?module=bb&op=viewtopic&t=108175
> It would be very helpful if these changes, or similar functionality, can be included in 3.1, as I wouldn't need to keep maintaining my own custom version of the GD feature. I'd be happy to post a patch, if that helps (while my changes are very simple, as described in the post)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list