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
Balaji,

what didn't work? Wasn't the code executed or didn't you get  the right results? A couple of things I noticed:

* you don't *need* to extend Activiti Designer's functionality to do this - you can use standard Eclipse context menus with commands and handlers to do the same, but this should work.
* You created a sub menu entry, but I don't see code where you added it to the result list:
IContextMenuEntry ret[] = new IContextMenuEntry[] { subMenuExport, subMenu1Export };
* In your feature, you are invoking BpmnXmlExport, of which I can only assume it's our class. That will always lead to OUR export and not your own. Use ExtensionUtil.getMarshaller() to get your marshaller by its name (0.6.0) or iterate through the extensions of the ExportMarshaller extension point (0.5.0) to get your own before invoking. What you're doing now will create the .bpmn20.xml file, which is probably not what you're trying to do.

balaji1
Champ in-the-making
Champ in-the-making
HI,

* you don't *need* to extend Activiti Designer's functionality to do this - you can use standard Eclipse context menus with commands and handlers to do the same, but this should work.
Can you please elaborate this point?

* You created a sub menu entry, but I don't see code where you added it to the result list:
IContextMenuEntry ret[] = new IContextMenuEntry[] { subMenuExport, subMenu1Export };

Is the below code not enough to create that menu?  Because i could see the menu option is created.

* In your feature, you are invoking BpmnXmlExport, of which I can only assume it's our class. That will always lead to OUR export and not your own. Use ExtensionUtil.getMarshaller() to get your marshaller by its name (0.6.0) or iterate through the extensions of the ExportMarshaller extension point (0.5.0) to get your own before invoking. What you're doing now will create the .bpmn20.xml file, which is probably not what you're trying to do.

Yeah this is I need to change to our acme marshall. I have created acme plugin project and also created a seperate class
SaveAcmeModelFeature in org.activiti.designer.features project. What changes are expected to trigger our marshall?

balaji1
Champ in-the-making
Champ in-the-making
Tiese,
Please rescue us!!!!

THanks

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

I just meant you don't need to extend our functionality by changing or adding code, because using the standard mechanisms of Eclipse, you can create menu entries within the context of a different plugin if you know its partId. For instance somthing like this:

<handler class="org.acme.ExampleHandler" commandId="org.acme.exampleCommand">
      <enabledWhen>
     <with variable="activePartId">
          <equals value="org.activiti.designer.bpmneditor" />
        </with>
      </enabledWhen>
    </handler>

That enables a handler for the context of the Activiti Editor. If you then add the command to a right click menu and implement a command, that would also work. Never mind, the way you're doing it is fine too.

If the menu is created already, then don't worry about my remark. Since you didn't indicate what the problem was, I was just making general remarks.

Further actions are as I mentioned. In your separate SaveAcmeModelFeature, there's a method that gets invoked when the menu item is clicked. At that point, retrieve an instance of your ExportMarshaller by the means I referred to, and simply invoke it as we do in the SaveBpmnModelFeature.

balaji1
Champ in-the-making
Champ in-the-making
HI,

I have just created dependency to GUI project with my new acme project.

But the corresponding class in my acme project  is not visible in my new saveacmemodelfeature  class in gui project.

THanks

tiesebarrell
Champ in-the-making
Champ in-the-making
Shouldn't the dep be the other way around? Anyway, you should have no dep that way because you can use  the ExportMarshaller interface to invoke

balaji1
Champ in-the-making
Champ in-the-making
HI,

As I mentioned before I have seperate acme project which as acme marshaller and also created a seperate class
called SaveAcmeModelFeature in GUI project. I have removed the dependencies.

I could see the below BPMNexport class should be changed to acme marshall.

boolean validBpmn = BpmnXMLExport.validateBpmn(getDiagram().eResource().getContents(), project, parentDiagramName);
   if(validBpmn) {
   
    BpmnXMLExport.createBpmnFile(bpmnUri, getDiagram(), project, parentDiagramName);
  
But the acme marshaller class is not reachable to this  new class.
Can you please tell us where I am going wrong.
ALso let us know is any other changes needs to be done.

balaji1
Champ in-the-making
Champ in-the-making
Tiese,
TO add my question

1. BAsically I could not see one difference between two XML's generated.
Can you please tell us the reason.  The difference is in "activiti:class="hh".

Whle Export
*************
<?xml version="1.0" encoding="UTF-8"?>
<Process xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn"
typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath"
targetNamespace="http://www.activiti.org/test">
<process id="helloworld" name="helloworld">
  <StartEvent id="startevent1" name="Start"></StartEvent>
  <serviceTask id="servicetask1" name="Service Task"
   activiti:class="hh"></serviceTask>
  <sequenceFlow id="flow1" name="" sourceRef="startevent1"
   targetRef="servicetask1"></sequenceFlow>
  <sequenceFlow id="flow2" name="" sourceRef="servicetask1"
   targetRef="endevent1"></sequenceFlow>
  <endEvent id="endevent1" name="End"></endEvent>
</process>
</Process>

While Saving
***************
<?xml version="1.0" encoding="UTF-8"?>
<Process xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:Etrade="http://activiti.org/bpmn"
typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath"
targetNamespace="http://www.activiti.org/test">
<process id="helloworld" name="helloworld">
  <startEvent id="startevent1" name="Start"></startEvent>
  <serviceTask id="servicetask1" name="Service Task"
   activiti:expression="hh"></serviceTask>
  <sequenceFlow id="flow1" name="" sourceRef="startevent1"
   targetRef="servicetask1"></sequenceFlow>
  <sequenceFlow id="flow2" name="" sourceRef="servicetask1"
   targetRef="endevent1"></sequenceFlow>
  <endEvent id="endevent1" name="End"></endEvent>
</process>
</Process>

THanks

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

I've mentioned this before, so I will not belabor the point. That there are two implementations to create the BPMN is a *bug*, not a feature. It has already been removed. So there is no good "reason" for any differences, just one is newer and the other is… older.

I don't know how I can make this any clearer: you don't need a dependency. You need you extension bundle project, with you marshaller in it. which you have. Then you need your additions to the gui project for the context menu, which you have. You should now just do this in the class in the gui project that handles the context menu click (pseudo code):

final List<ExportMarshaller> marshallers = ExtensionUtil.getActiveMarshallers();

for (final ExportMarshaller marshaller : marshallers) {
if ("myMarshallerName".equals(marshaller.getName())) {
marshaller.marshallDiagram();
}

As you can see, I don't need the actual marshaller class because all I need is a reference to an ExportMarshaller (i.e., the interface).

balaji1
Champ in-the-making
Champ in-the-making
Tiese,
So I can assume that in the next release (0.6.0)

There is goanna be only One BPMN Export marshaller and there are two ways to crete XML from this
1. Control -S
2. Export Menu Option

ALso, Can you please pass on the link to checkout the latest source(0.6.0)?

Thanks