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
Can anyone please reply to the bove question?

Thanks

balaji1
Champ in-the-making
Champ in-the-making
Tiese,
Can you please help us with above questrion?

Are you there?

Thanks

tiesebarrell
Champ in-the-making
Champ in-the-making
OK, so if you change the original code, the changes are reflected, so that works. I assume you are using Run as > Eclipse application to include your own ExportMarshaller in Eclipse, otherwise you wouldn't have the option to turn on the marshaller in the preferences. If you place a breakpoint in the ActivitiDiagramEditor class where it collects all of the active marshallers, and you use ctrl-s to save the diagram, does your marshaller show up in the list it resolves?

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

Atlast, it got worked Smiley Happy

I have asked the below question many times. But I am putting it in different way now.

1. Basically, XML is created while saving (ctrl + s) and also while exporting to BPMN 2.0 . I guess format and structure remains same for both the process..

Why do we need both of them. Can we have any one process either save or export?


Thanks

balaji1
Champ in-the-making
Champ in-the-making
Tiese,
Please help us with the above question.

Thanks

tiesebarrell
Champ in-the-making
Champ in-the-making
Balaji,

great you got it to work. What was it in the end that caused the problem?

it's true we left both the options in Activiti Designer. From the next release, they will also execute the exact same code and therefore have the same results. The reason for this is that we want to provide choice. If you want to force an export by using right-click, why would we not allow you to do this? Furthermore, if you don't want the BPMN to be created each time you save the diagram (so you've turned it off in the preferences), how else could you get the tool to perform an export at the moment you need it to? The right-click option enables you to do this: turn the preference off and perform the export by hand when you want to.

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

The problem is i have returned null statement in Filenamepattern function which caused this problem.
Thanks for your explanation.

Now , I have added one more menu option to export our XML format apart from activiti. If I click activiti it should export the XML
in activiti format  and similarly to our format (it should call acme class to create xml).

any clues? Btw today r u busy? Smiley Happy


Thanks

tiesebarrell
Champ in-the-making
Champ in-the-making
Ah, well, the Javadoc says you should never return null there Smiley Wink In 0.6.0 that method is removed anyway and therefore no longer checked. From 0.6.0 you can create your own resources so it's your problem from then on Smiley Happy

You need to invoke a handler from your command (I used this resource to learn: http://www.vogella.de/articles/EclipseCommands/article.html). In the handler, use ExtensionUtil to get your marshaller by name (from, again, 0.6.0, you can do this) and execute it in a runnable with progress. If you look in svn, there's code in the SaveBpmnModelFeature class that does the same:

  final IProgressService progressService = PlatformUI.getWorkbench().getProgressService();
      final ExportMarshallerRunnable runnable = new ExportMarshallerRunnable(getDiagram(), <name of your marshaller>);
      progressService.busyCursorWhile(runnable);

No I'm not busy today, I actually have a couple of days off (holiday).

balaji1
Champ in-the-making
Champ in-the-making
HI,
Now I am trying to perform below task

As I mentioned before , We are trying to add a export menu option apart from "Export to BPMN 2.0". So that
If I click my menu it should trigger acme marshall and generate the XML.
If I click "Export to BPMN 2.0" option it should trigger bpmnexport marshall and generate in activiti format.

——–
I did the below things

1. Added the below code  in  ActivitiToolbehaviouirprovider class.
    ContextMenuEntry subMenu1Export = new ContextMenuEntry(new     SaveAcmeModelFeature(getFeatureProvider()),context);
    subMenu1Export.setText("Export to My XML"); //$NON-NLS-1$
    subMenu1Export.setSubmenu(false);

2. Created another class in GUI project for acme

package org.activiti.designer.features;

import org.activiti.designer.xml.BpmnXMLExport;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.emf.common.util.URI;
import org.eclipse.graphiti.features.IFeatureProvider;
import org.eclipse.graphiti.features.context.ICustomContext;
import org.eclipse.graphiti.features.custom.AbstractCustomFeature;

public class SaveAcmeModelFeature extends AbstractCustomFeature{

public SaveAcmeModelFeature(IFeatureProvider fp) {
  super(fp);
}

@Override
public String getName() {
  return "Save to acme 2.0"; //$NON-NLS-1$
}

@Override
public String getDescription() {
  return "Generate the acme 2.0 xml file"; //$NON-NLS-1$
}

@Override
public boolean canExecute(ICustomContext context) {
  return true;
}

public void execute(ICustomContext context) {
  try {
   URI uri = getDiagram().eResource().getURI();
   URI bpmnUri = uri.trimFragment();
   bpmnUri = bpmnUri.trimFileExtension();
   bpmnUri = bpmnUri.appendFileExtension("acme.xml");
  
   IProject project = null;
   String parentDiagramName = null;
   if (bpmnUri.isPlatformResource()) {
    String platformString = bpmnUri.toPlatformString(true);
    IResource fileResource = ResourcesPlugin.getWorkspace().getRoot().findMember(platformString);
    if(fileResource != null) {
     project = fileResource.getProject();
     parentDiagramName = uri.trimFragment().trimFileExtension().lastSegment();
    }
   }
   boolean validBpmn = BpmnXMLExport.validateBpmn(getDiagram().eResource().getContents(), project, parentDiagramName);
   if(validBpmn) {
   
    BpmnXMLExport.createBpmnFile(bpmnUri, getDiagram(), project, parentDiagramName);
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    IPath location = Path.fromOSString(bpmnUri.toPlatformString(false));
    IFile file = workspace.getRoot().getFile(location);
    file.refreshLocal(IResource.DEPTH_INFINITE, null);
   }

  } catch(Exception e) {
   e.printStackTrace();
  }
}
}


But still it did not work in our way. Can you please help us.

balaji1
Champ in-the-making
Champ in-the-making
Tiese,
Please reply.

THanks