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,
Presently , We are trying two stuffs.

1. We added our own export XML menu and trying to call our marshaller. We have created saveacme class similar to savebpmn class. In save acme class we are not able to invoke our own marshaller. Its still calling bpmn marshaller. I understand the present code is running for ur marshaller. Dunno how to call ours.
—————-
2. After we created custom node. We have a question that is it possible to exhibit manual task properties and XML rather than service task property and xml's. I u nderstand abstract custom service class is extended. But still is it possible to have that manual task property to set. If yes, How?

Also can you please tell which class to refer for the formation of XML files/tags or to say xml file structure once the diagram is done.

Looking forward for you reply.

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

in your SaveAcmeModelFeature, you should do this:
final IProgressService progressService = PlatformUI.getWorkbench().getProgressService();
final ExportMarshallerRunnable runnable = new ExportMarshallerRunnable(getDiagram(), "AcmeMarshallerName");
progressService.busyCursorWhile(runnable);

Where "AcmeMarshallerName" is the value you return in the getMarshallerName() method of your own marshaller. These must match exactly and should not be the same as the BPMN marshaller's name.

2. No, that's not possible. All CustomServiceTasks are ServiceTasks, period. You cannot expose manual task properties there. If you want to set properties you would otherwise set on a manual task, you can only use the types from the PropertyType class to mimic their behavior.

Do you mean indenting the XML? AFAIK, you can't easily create an indented XML with a stream writer, without using one of the wrapper classes available in some third party libs. If you instead use XSLT in your marshaller, you could do that.

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

Actually we are trying to add one more property to the customised node. After adding it, How to generate
corresponding XML tag to that property. BEcause of addition how will the the xml structure will get affected.

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

any property you add to a CustomServiceTask is stored in a CustomProperty element in the .activiti file. Most are also exported to the BPMN as properties to be injected into the runtime class of the ServiceTask, though not all have been checked at the moment.  Obviously, the syntax of that injection is Activiti/Spring-specific as BPMN doesn't prescribe that level of detail.

If you are using an ExportMarshaller to generate you own XML, you can use the ExtensionUtil.getCustomProperty() method to get to any custom property when you have the ServiceTask. The name of the property you request is the same as the name of the member in the CustomServiceTask's class. For instance:

In your CustomServiceTask:

@Property(type = PropertyType.TEXT, …)
private String myProperty;

The simple value of that TEXT field can be picked up from the ServiceTask in your ExportMarshaller like this:
ExtensionUtil.getCustomProperty(serviceTask, "myProperty").getSimpleValue();

tombaeyens
Champ in-the-making
Champ in-the-making
Balaji,

It's the second time I see you pinging for faster answers.  Please be more patient.

Please read this carefully http://www.catb.org/~esr/faqs/smart-questions.html

balaji1
Champ in-the-making
Champ in-the-making
Hi,
Consider the below code

@Property(type = PropertyType.TEXT, displayName = "ActId", required = true)
  @Help(displayHelpShort = "Provide an account number", displayHelpLong = HELP_ACCOUNT_NUMBER_LONG)
  private String ActId;

And in the export marshaller
ExtensionUtil.getCustomProperty(serviceTask, "ActId").getSimpleValue();

I hope the above logic pulls the value for XML tag. Suppose If  I want to populate in XML as <ActId>XXX<ActId>. How to generate that ACTID tag and populate XX from marshaller.

THanks

tiesebarrell
Champ in-the-making
Champ in-the-making
Assuming you have an ExportMarshaller, you would probably setup a stream writer like this:

final XMLOutputFactory xof = XMLOutputFactory.newInstance();
      final ByteArrayOutputStream baos = new ByteArrayOutputStream();
      final OutputStreamWriter out = new OutputStreamWriter(baos, "UTF-8");
      final XMLStreamWriter xtw = xof.createXMLStreamWriter(out);

then somewhere in the structure,

//start the ActId element
xtw.writeStartElement("ActId");

xtw.writeCharacters(ExtensionUtil.getCustomProperty(serviceTask, "ActId").getSimpleValue());

//end the ActId element
xtw.writeEndElement();

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

I did the change as you mentioned .

  ServiceTask ServiceTask = null;
   xtw.writeCharacters(ExtensionUtil.getCustomProperty(ServiceTask, "ActId").getSimpleValue());
        xtw.writeEndElement();

xtw.writeStartElement("ActName");
        xtw.writeAttribute("Mandatory", "Yes");
        xtw.writeCharacters(ExtensionUtil.getCustomProperty(ServiceTask, "ActName").getSimpleValue());
        xtw.writeEndElement();
       
        xtw.writeStartElement("ActType");
        xtw.writeCharacters(ExtensionUtil.getCustomProperty(ServiceTask, "ActName").getSimpleValue());
        xtw.writeEndElement();
       
        xtw.writeStartElement("AppId");
        xtw.writeAttribute("Mandatory", "Yes");
        xtw.writeCharacters(ExtensionUtil.getCustomProperty(ServiceTask, "AppId").getSimpleValue());
        xtw.writeEndElement();


And I am facing below error
Marshalling to Acme Format 1.15 format was skipped because validation of the diagram failed
Marshalling to Activiti BPMN 2.0 format was skipped because validation of the diagram failed.
ServiceTask Manual Task has no class specified


THanks

tiesebarrell
Champ in-the-making
Champ in-the-making
You have added a service task, which you have apparently named Manual Task, but you haven't specified the class property. Marshalling will only be performed if validation succeeds. That's what those messages mean. If your ExportMarshaller attempts to perform the BPMN validations first, then it will be blocked for the same reason and not produce XML. But since you wrote the ExportMarshaller, I assume you know that Smiley Happy

balaji1
Champ in-the-making
Champ in-the-making
Tiese,
Can you please elaborate the mistake I made.
It is the issue with class property.