Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355675 - BPMN2 Modeler Usability: call activity assistance
Summary: BPMN2 Modeler Usability: call activity assistance
Status: RESOLVED FIXED
Alias: None
Product: BPMN2Modeler
Classification: SOA
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: future   Edit
Assignee: Robert Brodt CLA
QA Contact:
URL: https://issues.jboss.org/browse/JBPM-...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-24 06:40 EDT by Robert Brodt CLA
Modified: 2012-10-09 11:49 EDT (History)
1 user (show)

See Also:
bbrodt: iplog+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Brodt CLA 2011-08-24 06:40:27 EDT
Display popup dialog for smarter call activity configuration.

-> processId selection and assisted input/output mapping
Comment 1 Robinson S CLA 2012-09-11 08:38:38 EDT
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.
Comment 2 Robinson S CLA 2012-09-11 08:40:47 EDT
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;
}
Comment 3 Robinson S CLA 2012-09-11 08:43:07 EDT
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);
Comment 4 Robert Brodt CLA 2012-09-16 11:06:37 EDT
Done. I've changed the category for Task to Activity as you suggested.