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
If you added a regular service task, then you'll have to specify the class property before you can marshall. Fill it in the property screen.

balaji1
Champ in-the-making
Champ in-the-making
Tiese,
I am sorry , Can you please tell the above process.
I am attaching the code for acme marshaller and acme money task.

Thanks

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

I see. You need to separate two concepts: there are CustomServiceTasks and ServiceTasks. A CustomServiceTask extends a regular ServiceTask, but in a way that is no longer valid according to Activiti Designer. So if you want to use a CustomServiceTask, like you have the AcmeMoneyTask, you can no longer use the Activiti BPMN validation because it will always fail. You should uncheck the validation option in the preferences and write your own if you have some own validations to do.

Besides that, you should not be invoking the BPMN validation from your Marshaller. So get rid of that part or point it to your own validator if you have one.

Also, I don't really understand why your Marshaller name points to some constant in ActivitiBpmnDiagramConstants. I would move that constant to a class in your extension project and leave our class untouched in that regard. The reason for this is that *your* extension's Marshaller name is *not* an ActivitiBpmnDiagramConstant, purely by its nature of being an extension.

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

Can you please tell now what more changes I need to perform.
Basically I introduced few more properties in custom node. And in acme marshaller, I am writing the xml structure for those proeprties.

tiesebarrell
Champ in-the-making
Champ in-the-making
You need to remove the validation you're forcing in your marshaller. Then disable BPMN validation in Eclipse's preferences.

balaji1
Champ in-the-making
Champ in-the-making
Tiese,
I commented out the below code which does validation.

// Validate if the BPMN validator is checked in the preferences
    /*  if (PreferencesUtil.getBooleanPreference(Preferences.VALIDATE_ACTIVITI_BPMN_FORMAT)) {

         boolean validBpmn = invokeValidator(ActivitiBPMNDiagramConstants.BPMN_VALIDATOR_ID, diagram, monitor);

         if (!validBpmn) {

           // Get the behavior required
           final String behavior = PreferencesUtil.getStringPreference(Preferences.SKIP_BPMN_MARSHALLER_ON_VALIDATION_FAILURE);

           // Flag marshalling to be skipped if the behavior is to skip or not
           // defined (mirrors default behavior)
           if (behavior == null || ActivitiBPMNDiagramConstants.BPMN_MARSHALLER_VALIDATION_SKIP.equals(behavior)) {
             performMarshalling = false;
             // add additional marker for user
             addProblemToDiagram(diagram, "Marshalling to " + getFormatName() + " format was skipped because validation of the diagram failed.", null);
           }
         }
       } */


Now how to define the service task from the below code?
      xtw.writeCharacters(ExtensionUtil.getCustomProperty(ServiceTask, "ActId").getSimpleValue());

THanks

tiesebarrell
Champ in-the-making
Champ in-the-making
Good, that's what I meant.

I don't understand the question. The code you mention outputs the string value of a CustomProperty to the XML. What's that got to do with defining a ServiceTask?

balaji1
Champ in-the-making
Champ in-the-making
Tiese,
As mentioned in the previous thread. I want my xml as <ActId>XXX<Actid>

xtw.writeStartElement("ActId");
        xtw.writeAttribute("Mandatory", "Yes");
        xtw.writeCharacters(ExtensionUtil.getCustomProperty(ServiceTask, "Actid").getSimpleValue());
        xtw.writeEndElement();

Now I am getting error "ServiceTask cannot be resolved to a variable". Can I declare ServiceTask servicetask = null ??
I need to use service task here rite?

THanks

tiesebarrell
Champ in-the-making
Champ in-the-making
I assumed you were iterating the contents of the diagram while using that code, so you would have a particular node as context info at that point. You forgot that part. Do something like this:

final List<EObject> objects = getResourceForDiagram(diagram).getContents();
for (final EObject obj : objects) {
  if (ExtensionUtil.isCustomServiceTask(obj)) {
    ServiceTask serviceTask = (ServiceTask) obj;
    … etc.
  }
}

balaji1
Champ in-the-making
Champ in-the-making
Tiese,
Thanks for your quick response.

I  made the above code change. I have attached source file.
After I launch the eclipse , My marshaller is not being called. Only your marshaller is called.
Even I turned off validate diagram of BPMN

I got the below exception.

An exception occurred while creating the BPMN 2.0 XML: null
org.activiti.designer.eclipse.activitiMarshallerMarker