Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BPMN 2.0 Modeler » How do I create a custom editor with the BPMN2 Modeler?
How do I create a custom editor with the BPMN2 Modeler? [message #1729946] Wed, 20 April 2016 12:39 Go to next message
Jonas Le is currently offline Jonas LeFriend
Messages: 2
Registered: April 2016
Junior Member
I have added a new Work Definitions which gets picked up under Custom Tasks in the editor:
[
    "name" : "BooleanQuestion",
    "parameters" : [
        "Question" : new StringDataType()
    ],
    "displayName" : "Yes/No Question",
    "eclipse:customEditor" : "com.common.workeditor.MyWorkEditor"
]


The editor I have defined looks like this:
public class MyWorkEditor extends Dialog implements WorkEditor {
	private final String title = "My editor";
	
    protected MyWorkEditor(Shell parentShell) {
		super(parentShell);
		
		throw new RuntimeException("sad");
	}
    
    @Override
    protected void configureShell(Shell newShell) {
    	super.configureShell(newShell);
    	newShell.setText(title);
    }
    
    protected Control createDialogArea(Composite parent) {
        Composite composite = (Composite) super.createDialogArea(parent);
        GridLayout gridLayout = new GridLayout();
        gridLayout.numColumns = 2;
        composite.setLayout(gridLayout);
        
        //Work work = (Work) getValue();
        
        Label nameLabel = new Label(composite, SWT.NONE);
        nameLabel.setText("Name: "); //$NON-NLS-1$
        nameLabel.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
        
        Text nameText = new Text(composite, SWT.NONE);
        nameText.setEditable(false);
        nameText.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1));
        String name = "MyName";
        nameText.setText(name == null ? "" : name); //$NON-NLS-1$
        
        return composite;
    }
    
	@Override
	public void setWorkDefinition(WorkDefinition definition) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void setWork(Work work) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public boolean show() {
		int result = open();
        return result == OK;
	}
	@Override
	public Work getWork() {
		// TODO Auto-generated method stub
		return null;
	}
}


Using the old Drools plugin for Eclipse I could simply double click the node and use a custom editor (not this exact one, but in similar). However, double clicking my Yes/No Question doesn't do anything. Am I on the wrong path here?
Re: How do I create a custom editor with the BPMN2 Modeler? [message #1729970 is a reply to message #1729946] Wed, 20 April 2016 15:36 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hi Jonas,

I'm sorry, but the ability to provide your own custom editor is not yet implemented. Instead, the parameters will appear in the "Custom Task" tab of the property sheet, for example:

http://content.screencast.com/users/BobBrodt/folders/Jing/media/b63c6b39-659e-43c5-b034-fe46aecbf1a5/2016-04-20_0934.png

If you absolutely must have this functionality, please file an enhancement request - we'll try to get it into the next Neon release.

Cheers,
Bob
Re: How do I create a custom editor with the BPMN2 Modeler? [message #1730082 is a reply to message #1729970] Thu, 21 April 2016 10:06 Go to previous message
Jonas Le is currently offline Jonas LeFriend
Messages: 2
Registered: April 2016
Junior Member
Hi, and thanks for your reply Bob!

Yes, we have some properties which requires a custom editor to allow us to migrate to this plugin. I found https://bugs.eclipse.org/bugs/show_bug.cgi?id=373068 on the issue tracker, and I suspect that is what we need? I added a vote for it as well.

Thanks for helping!

Jonas
Previous Topic:Change Process ID, BPMN2 elements ID
Next Topic:EventBasedGateway with catch events always shows validation errors
Goto Forum:
  


Current Time: Thu Apr 25 01:48:25 GMT 2024

Powered by FUDForum. Page generated in 0.03127 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top