| Summary: | BPMN2 Modeler Usability: call activity assistance | ||
|---|---|---|---|
| Product: | [SOA] BPMN2Modeler | Reporter: | Robert Brodt <bbrodt> |
| Component: | UI | Assignee: | Robert Brodt <bbrodt> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | robin7013 |
| Version: | unspecified | Flags: | bbrodt:
iplog+
|
| Target Milestone: | future | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| URL: | https://issues.jboss.org/browse/JBPM-3263 | ||
| Whiteboard: | |||
|
Description
Robert Brodt
I have three solutions for this issue. Solution 1: The preference page for properties is grouped well based on the major categories of the bpmn2 elements. One thing missed out or not considered in the group is the Activity. Task is treated as the category whereas I believe it should be Activity. Enabling show properties for all the activities and keeping the ShowPropertiesFeature as the top custom feature in the list will make the behavior common for all bpmn2 elements of type Activity. Solution 2:
Make the following method in BpmnToolBehaviourFeature.java return only ShowPropertiesFeature so that double click always open popup and not other actions like expand/collapse
@Override
public ICustomFeature getDoubleClickFeature(IDoubleClickContext context) {
ICustomFeature[] cf = getFeatureProvider().getCustomFeatures(context);
for (int i = 0; i < cf.length; i++) {
ICustomFeature iCustomFeature = cf[i];
if (iCustomFeature instanceof ShowPropertiesFeature && iCustomFeature.canExecute(context)){
return iCustomFeature;
}
}
return null;
}
Also in hasPopupConfigDialog(Object context) method in Bpmn2Preferences.java the following code should be inserted.
if (context instanceof CallActivity){
return true;
}
To have popup for all the activities the following code can be used.
if (context instanceof Activity){
return true;
}
Solution 3:
Move up ShowPropertiesFeature to the top in the list of custom features (CallActivityFeatureContainer.java)
@Override
public ICustomFeature[] getCustomFeatures(IFeatureProvider fp) {
ICustomFeature[] superFeatures = super.getCustomFeatures(fp);
ICustomFeature[] thisFeatures = new ICustomFeature[superFeatures.length];
int index = 1;
for (int i=0; i<superFeatures.length; ++i){
if(superFeatures[i] instanceof ShowPropertiesFeature){
thisFeatures[0] = superFeatures[i];
index = 0;
}else{
thisFeatures[index+i] = superFeatures[i];
}
}
return thisFeatures;
}
Insert the following piece of code in hasPopupConfigDialog(Object context) method in Bpmn2Preferences.java
if (context instanceof CallActivity) {
return true;
}
This will open the popup configuration dialog when call activity is double clicked in the diagram editor.
In case popup configuration dialog is required on creation of call activity as well, insert this code in getShowPopupConfigDialog(Object context) in Bpmn2Preferences.java.
if (context instanceof CallActivity) {
return popupConfigDialogFor[6];
}
Moreover following changes should be done in Bpmn2Preferences.java
1) popupConfigDialogFor[] array size should be increased to 7.
2) In load() method, add popupConfigDialogFor[6] = getBoolean(PREF_POPUP_CONFIG_DIALOG_FOR_ACTIVITIES, false);
3) In save() method, add setBoolean(PREF_POPUP_CONFIG_DIALOG_FOR_ACTIVITIES, popupConfigDialogFor[6]);
4) In createFieldEditors() method (Bpmn2HomePreferencePage.java) add the following code.
TristateCheckboxFieldEditor popupConfigDialogForActivities = new TristateCheckboxFieldEditor(
Bpmn2Preferences.PREF_POPUP_CONFIG_DIALOG_FOR_ACTIVITIES,
Bpmn2Preferences.PREF_POPUP_CONFIG_DIALOG_FOR_ACTIVITIES_LABEL,
comp);
addField(popupConfigDialogForActivities);
popupConfigDialog.addField(popupConfigDialogForActivities);
Done. I've changed the category for Task to Activity as you suggested. |