cancel
Showing results for 
Search instead for 
Did you mean: 

How to run the activiti source code?

balaji1
Champ in-the-making
Champ in-the-making
Hi,

1. We have checked out the source code from SVN and installed in SVN.
Can you please tell us how to build this source code?

ALso what will be the outcome of this process?

2. We have proposed to use activiti plugin for our porject. We need to customise the palette shapes and XML tags. Can you please tell us the process to perform.


Please help us to resolve to above issues. We are badly stuck up here.
294 REPLIES 294

balaji1
Champ in-the-making
Champ in-the-making
Tiese,
Here is  the classs and made corresponding changes to other classes as well.

package org.activiti.designer.property.extension.field;

import java.lang.reflect.Field;



import org.activiti.designer.integration.servicetask.PropertyType;
import org.activiti.designer.integration.servicetask.validator.RequiredFieldValidator;
import org.activiti.designer.property.PropertyCustomServiceTaskSection;
import org.eclipse.bpmn2.ServiceTask;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;

/**
* @author Tiese Barrell
* @since 0.6.1
* @version 1
*/
public class CustomPropertyComboFields extends AbstractCustomPropertyField {


private CCombo comboControl;
final String[] ITEMS = { "111", "112", "113", "114", "115"};

  public CustomPropertyComboFields(final PropertyCustomServiceTaskSection section, final ServiceTask serviceTask, final Field field) {
    super(section, serviceTask, field);
  }

  @Override
  public PropertyType getPrimaryPropertyType() {
    return PropertyType.DROP_DOWN;
  }

  @Override
  public void refresh() {
    comboControl.setText(getSimpleValueFromModel());
  }

  @Override
  public String getSimpleValue() {
    return comboControl.getText();
  }

  @Override
  public Composite render(final Composite parent, final TabbedPropertySheetWidgetFactory factory, final FocusListener listener) {

    final Composite result = factory.createFlatFormComposite(parent);
    FormData data;

    comboControl = factory.createCCombo(result,SWT.BORDER_SOLID);
    comboControl.setEnabled(true);

    if (getPropertyAnnotation().required()) {
      addFieldValidator(comboControl, RequiredFieldValidator.class);
    }

    if (getPropertyAnnotation().fieldValidator() != null) {
      addFieldValidator(comboControl, getPropertyAnnotation().fieldValidator());
    }

    comboControl.addFocusListener(listener);
   
    comboControl.setItems(ITEMS);

    data = new FormData();
    data.left = new FormAttachment(0);
    data.top = new FormAttachment(0);
    data.right = new FormAttachment(100);
    comboControl.setLayoutData(data);

    return result;
  }
}

But in the above progra,, it goanna return the same list of values for all the properties. I do  not want this.

Thanks

tiesebarrell
Champ in-the-making
Champ in-the-making
If you need different options, then the best way to go, as with other components, is to add an annotation to the integration library that allows you to specify the list of options on the CustomServiceTask. That's what I'll be doing for the "official combobox". In that case you code is generic and you can instruct it for each property field.

balaji1
Champ in-the-making
Champ in-the-making
Tiese,

Can you please help me to set up checkbox with any of the proprties.
I tried searching in SWT widgets tutorial and got the below code.

Display display = new Display();
    Shell shell = new Shell(display);
    shell.setLayout(new GridLayout(3, true));

    // Create three checkboxes
    new Button(shell, SWT.CHECK).setText("Checkbox 1");
    new Button(shell, SWT.CHECK).setText("Checkbox 2");
    new Button(shell, SWT.CHECK).setText("Checkbox 3");

    shell.pack();
    shell.open();


But it throws exception at Display and not able to launch.

Thanks

tiesebarrell
Champ in-the-making
Champ in-the-making
I don't think you should be creating a new Display and/or Shell. You should use the mechanisms as used for the other components to integrate it into the PropertySection.

tiesebarrell
Champ in-the-making
Champ in-the-making
Again,

do you really need to be doing this now? These components will be in Activiti Designer at the beginning of February, so you probably don't need to create them yourself.

balaji1
Champ in-the-making
Champ in-the-making
Tiese,
Just out of curiositty,

Process to create checkbox using below syntax rite?

Button checkBox = new Button(shell, SWT.CHECK);

If we dont have to create shell. What needs to be given in place of shell?

Thanks

tiesebarrell
Champ in-the-making
Champ in-the-making
It needs to be a Composite in the PropertySection.

balaji1
Champ in-the-making
Champ in-the-making
Tiese,

Could you please elaborate it.
There is a necessity for to implement now.Thats y.

    Composite Parent;
Button checkBox = new Button(Parent, SWT.CHECK);
Will the above one suffice?
Thanks
Balaji  V

tiesebarrell
Champ in-the-making
Champ in-the-making
If the parent variable is a composite in the PropertySection, that should work, yes.

balaji1
Champ in-the-making
Champ in-the-making
Tiese,

In the proeprtysEction class

   case CHECK_BOX:
              createdCustomPropertyField = new CustomPropertyCheckboxFields(this, serviceTask, fieldInfo.getField());
              createdControl = createdCustomPropertyField.render(workParent, factory, listener);
              data = new FormData();
              data.top = new FormAttachment(previousAnchor, VSPACE);
              data.left = new FormAttachment(0, LABEL_COLUMN_WIDTH);
              data.right = new FormAttachment(100, -HELP_COLUMN_WIDTH);
              createdControl.setLayoutData(data);
              break;

// IN custom class

/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.activiti.designer.property.extension.field;

import java.lang.reflect.Field;



import org.activiti.designer.integration.servicetask.PropertyType;
import org.activiti.designer.integration.servicetask.validator.RequiredFieldValidator;
import org.activiti.designer.property.PropertyCustomServiceTaskSection;
import org.eclipse.bpmn2.ServiceTask;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;

/**
* @author Tiese Barrell
* @since 0.6.1
* @version 1
*/
public class CustomPropertyCheckboxFields extends AbstractCustomPropertyField  {

 
 

/*private CCombo comboControl;

final String[] ITEMS = { "Manual Bank Account Linking Request Processing",
                   "Manual Bank Adoption Agreement Processing",
                   "Manual Bank CIP Verification Document Processing",
                   "Manual Bank Corrected Tax Form Request Processing",
                   "Manual Bank Direct Rollover Processing"};*/
  
  
private Button checkBox;
     

  public CustomPropertyCheckboxFields(final PropertyCustomServiceTaskSection section, final ServiceTask serviceTask, final Field field) {
    super(section, serviceTask, field);
   
  }

  @Override
  public PropertyType getPrimaryPropertyType() {
    return PropertyType.CHECK_BOX;
  }

  @Override
  public void refresh() {
   checkBox.setText(getSimpleValueFromModel());
  }

  @Override
  public String getSimpleValue() {
    return checkBox.getText();
  }

  @Override
  public Composite render(final Composite parent, final TabbedPropertySheetWidgetFactory factory, final FocusListener listener) {

    final Composite result = factory.createFlatFormComposite(parent);
    FormData data;
   
   
    checkBox= new Button(parent, SWT.CHECK);

    if (getPropertyAnnotation().required()) {
      addFieldValidator(checkBox, RequiredFieldValidator.class);
    }

    if (getPropertyAnnotation().fieldValidator() != null) {
      addFieldValidator(checkBox, getPropertyAnnotation().fieldValidator());
    }

    checkBox.addFocusListener(listener);
   
    //button.setItems(ITEMS);


    data = new FormData();
    data.left = new FormAttachment(0);
    data.top = new FormAttachment(0);
    data.right = new FormAttachment(100);
    checkBox.setLayoutData(data);

    return result;
  }
}

I am getting null pointer exception at refresh in property section class.


  for (final CustomPropertyField field : customPropertyFields) {
      field.refresh();
    }