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

tiesebarrell
Champ in-the-making
Champ in-the-making
you should keep a running reference to the last "group" or "row" (or whatever metaphor works for you Smiley Wink) you created in the loop. Update it to the current one at the end of each iteration in the loop. You can see similar code in the class that creates the DATA_GRID type. Have a look there.

Alternatively, you could also use a GridLayout with the correct number of columns. Then you can simply drop in controls and they will be auto-layouted. How to do that is in the article as well.

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

I did as per your advice. I would want my property view as Checkbox and Comobolist.Where checkbox names will differ and my combo list remains same.

Below is my code. Still I am facing issue in it.
Composite render(final Composite parent, final TabbedPropertySheetWidgetFactory factory, final FocusListener listener) {

     final Composite result1 = factory.createFlatFormComposite(parent);
     Composite previousParent = result1;
 
     for(int i=1;i<10;i++)
   {
   
      Composite result = factory.createFlatFormComposite(result1);

      FormData data;
   
           
    checkBox = factory.createButton(result,"Test", SWT.CHECK);
    checkBox.setEnabled(true);
    checkBox.setText("Open");
   
    checkBox = factory.createButton(result,"Test", SWT.CHECK);
    checkBox.setEnabled(true);
    checkBox.setText("UnAssigned");
   
          
    comboControl = factory.createCCombo(result,SWT.BORDER_SOLID);
    comboControl.setEnabled(true);
   ….


comboControl.addFocusListener(listener);
    comboControl.setItems(ITEMS);
   
     
   
    data = new FormData();
  //  data.left = new FormAttachment(checkBox,40);
    data.top = new FormAttachment(previousParent,10);
    //data.right = new FormAttachment(100); */
    comboControl.setLayoutData(data);
   previousParent = result;
  
   }
    return result1;
  
  }

THanks

tiesebarrell
Champ in-the-making
Champ in-the-making
What's the problem?

balaji1
Champ in-the-making
Champ in-the-making
Tiese,
still  the controls got merged.
I have attached the code. AM I did it in the right way as you said?


Thanks

tiesebarrell
Champ in-the-making
Champ in-the-making
So, the code works fine, but your controls are all on top of each other? In that case, it's mainly a case of layouting the controls. For instance, to place them below each other, you should do something like this:

//running reference
Control runningControl = result;

//create first control somehow
FormData data = new FormData();
data.left = new FormAttachment(result, 0)
data.top  = new FormAttachment(runningControl, 0)
control1.setLayoutData(data);

runningControl = control1;

//for each next component
data = new FormData();
data.left = new FormAttachment(result, 0)
data.top  = new FormAttachment(runningControl, 0)
controlX.setLayoutData(data);

runningControl = controlX;

So you basically keep attaching the left side of the components to the parent control, and the top of them to the previous one you created (which makes it end up stuck to the previous one's bottom). You should make sure you create a NEW FormData for each one before you invoke setLayoutData().

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
This is certainly the longest topic I've ever seen. Many compliments to Tiese. And I hope Balaji will write several blogs about this, that can be used by others to help getting the designer better and better.

tiesebarrell
Champ in-the-making
Champ in-the-making
Ronald, thanks for that. In the meantime, it's also helped me understand where the documentation may be lacking or code changes might help others develop extensions to Designer

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Ahhh.. so in fact Balaji was your guinea pig 🙂

balaji1
Champ in-the-making
Champ in-the-making
Ronald,
Thanks for your compliments Smiley Happy

Thanks

balaji1
Champ in-the-making
Champ in-the-making
Tiese,
I am getting NPE @   comboControl.setLayoutData(data);
Here its the code change done. Please help.

//

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

    final Composite result1 = factory.createFlatFormComposite(parent);
     Composite previousParent = result1;

     for(int i=1;i<10;i++)
   {

     Composite result = factory.createFlatFormComposite(result1);
    Control runningControl = result;
      FormData data;

      data = new FormData();
      data.left = new FormAttachment(result, 40);
      data.top = new FormAttachment(runningControl, 30);
      comboControl.setLayoutData(data);

      runningControl = comboControl;


    checkBox = factory.createButton(result,"Test", SWT.CHECK);
    checkBox.setEnabled(true);
    checkBox.setText("Open");
    comboControl = factory.createCCombo(result,SWT.BORDER_SOLID);
    comboControl.setEnabled(true);

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

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

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

    data = new FormData();
    data.left = new FormAttachment(result, 40);
    data.top = new FormAttachment(runningControl, 10);
    checkBox.setLayoutData(data);
   
    runningControl = checkBox;
    previousParent = result;
  
  }
    return result1;
  
  }

Thanks