Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

BPMN2-Modeler/JBoss-Custom-WID-Editor

< BPMN2-Modeler
Revision as of 12:59, 31 March 2017 by Bbrodt.redhat.com (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

As of version 1.4.0 the BPMN2 Modeler now supports writing your own Work Item editor dialogs. To accomplish this, simply write your Java Dialog class as you would in the KIE Workbench and copy it into the appropriate package within your Drools/jBPM Eclipse project. Next, add the "eclipse:customEditor" property to your ".wid" JSON file. Here is a complete sample ".wid" file:

import org.drools.core.process.core.datatype.impl.type.StringDataType;

[
  [
    "name" : "Google Calendar",
    "description" : "Create a meeting in Google Calendar",
    "version" : "1.0",
    "parameters" : [
    	"FilePath" : new StringDataType(),
    	"User" : new StringDataType(),
    	"Password" : new StringDataType(),
    	"Body" : new StringDataType()
    ],
    "results" : [
    	"Output1" : new StringDataType(),
    	"Output2" : new StringDataType()
    ],
    "displayName" : "Google Calendar",
    "icon" : "google-calendar.png",
    "eclipse:customEditor" : "org.drools.eclipse.flow.common.editor.editpart.work.GoogleCalendarEditor",
    "category" : "Google",
    "defaultHandler" : "org.jbpm.process.workitem.google.calendar.GoogleCalendarWorkItemHandler",
    "dependencies" : [
    ]
  ]
]

The BPMN2 Modeler will find this ".wid" file and add it to the tool palette. To invoke your custom editor, click on the "gear" icon in the button pad of your custom task, labeled "Configure Work Item". The editor can also be opened from the "Custom Task" property page.

To get started quickly, you can simply have the BPMN2 Modeler generate a simple Work Item Editor dialog. If the Dialog class does not exist, the editor will ask if you would like to create one. Simply answer yes and the Java class for the Dialog will be created in your project.

Here is a short video that shows the new feature in action.

Back to the top