cancel
Showing results for 
Search instead for 
Did you mean: 

Own templates

gant
Champ in-the-making
Champ in-the-making
Hi,

In the latest version of Designer, it's possible to create new process models from templates. Activiti does provide several of them. How can I extend the Designer to have my own templates there? There is nothing about that in the user guide.

Thanks,
michael
16 REPLIES 16

trademak
Star Contributor
Star Contributor
Hi Michael,

That's because it's not yet extendable 😉
But it shouldn't be too hard to make it possible to have your own templates there.
I'll discuss it within the team.

Thanks,

gant
Champ in-the-making
Champ in-the-making
Hi,

So I have to wait for that  Smiley Sad Or try to do that myself, if you could tell where to start.

I tried to update the palette of the designer. Created the jar file as described in the user guide and added it to the user libraries in eclipse.

The extension is not visible. First of all I recognised, that there was no "Activiti Designer Extensions" group in my user libraries section of the java build path under preferences. Tried to create this manually and added the jar (standard and as a system-library). But the added shape is neither visible in the palette nor are the extensions shown in the project tree.

I use Activiti Designer 5.7.1 and Eclipse Indigo. As Dependency for designer-extensions I have version 5.7 since 5.7.1 was not found on your repository.

Regards
michael

trademak
Star Contributor
Star Contributor
Hi Michael,

The extensions mechanism is for including your own service tasks.
To support your own templates I'm thinking of a preferences screen where you can add direct links to BPMN 2.0 XML files.
Then we can extend the template list with these additional files.
How does that sound?

Best regards,

gant
Champ in-the-making
Champ in-the-making
Hi,

A preferences site for the custom templates sounds good.

But however, as I mentioned before, I'm not able to register my own service-tasks in the Designer. Do you have tipps for that?

Thanks
michael

trademak
Star Contributor
Star Contributor
Hi,

Okay. About the Designer extensions. Did you add a user library with that name in Eclipse?
Because you have to do that yourself and add the JAR file with the extension there.
Then you have to use Maven 3 with a mvn eclipse:eclipse to get the user library referenced from the project.
Then it should work.

Best regards,

firebird0001
Champ in-the-making
Champ in-the-making
Thanks! It worked for me when I used m2eclipse plugin and failed while using mvn from console (out of eclipse).

Now I got stuck at another point… I tried to start new process in activiti explorer with this AcmeMoneyTast and now I get "couldn't instantiate class org.acme.runtime.AcmeMoneyJavaDelegation" error. I placed the .jar file with classes in libs folder of activiti-explorer and activiti-rest.

Maybe some advices?

trademak
Star Contributor
Star Contributor
Does this JAR file also contain the AcmeMoneyJavaDelegation class?
What's the full stacktrace?

Best regards,

firebird0001
Champ in-the-making
Champ in-the-making
In user guide it is said "Note that the runtime class shouldn't be in your extension JAR, as it's dependent on the Activiti libraries."


Exception
com.vaadin.event.ListenerMethod$MethodException
Cause: com.vaadin.event.ListenerMethod$MethodException
Cause: org.activiti.engine.ActivitiException: couldn't instantiate class org.acme.runtime.AcmeMoneyJavaDelegation
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1193)
at com.vaadin.ui.Button.fireClick(Button.java:539)
at com.vaadin.ui.Button.changeVariables(Button.java:206)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(AbstractCommunicationManager.java:1299)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1219)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:735)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:296)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:501)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:864)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1665)
at java.lang.Thread.run(Thread.java:679)
Caused by: com.vaadin.event.ListenerMethod$MethodException
Cause: org.activiti.engine.ActivitiException: couldn't instantiate class org.acme.runtime.AcmeMoneyJavaDelegation
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1193)
at org.activiti.explorer.ui.form.FormPropertiesForm.access$000(FormPropertiesForm.java:45)
at org.activiti.explorer.ui.form.FormPropertiesForm$1.buttonClick(FormPropertiesForm.java:139)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:490)
… 22 more
Caused by: org.activiti.engine.ActivitiException: couldn't instantiate class org.acme.runtime.AcmeMoneyJavaDelegation
at org.activiti.engine.impl.util.ReflectUtil.instantiate(ReflectUtil.java:131)
at org.activiti.engine.impl.bpmn.helper.ClassDelegate.instantiateDelegate(ClassDelegate.java:156)
at org.activiti.engine.impl.bpmn.helper.ClassDelegate.getActivityBehaviorInstance(ClassDelegate.java:129)
at org.activiti.engine.impl.bpmn.helper.ClassDelegate.execute(ClassDelegate.java:110)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:44)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:497)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:492)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:52)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:497)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:492)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:497)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:492)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:49)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:497)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:492)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:65)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:497)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:492)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:115)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:497)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:492)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:36)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:497)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:492)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:497)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:492)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:332)
at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performOutgoingBehavior(BpmnActivityBehavior.java:102)
at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performDefaultOutgoingBehavior(BpmnActivityBehavior.java:51)
at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.leave(FlowNodeActivityBehavior.java:44)
at org.activiti.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior.leave(AbstractBpmnActivityBehavior.java:37)
at org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior.signal(UserTaskActivityBehavior.java:74)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.signal(ExecutionEntity.java:315)
at org.activiti.engine.impl.persistence.entity.TaskEntity.complete(TaskEntity.java:149)
at org.activiti.engine.impl.cmd.SubmitTaskFormCmd.execute(SubmitTaskFormCmd.java:74)
at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.activiti.engine.impl.FormServiceImpl.submitTaskFormData(FormServiceImpl.java:68)
at org.activiti.explorer.ui.task.TaskDetailPanel$4.handleFormSubmit(TaskDetailPanel.java:315)
at org.activiti.explorer.ui.form.FormPropertiesEventListener.componentEvent(FormPropertiesEventListener.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:490)
… 31 more
Caused by: org.activiti.engine.ActivitiClassLoadingException: Class not found: org.acme.runtime.AcmeMoneyJavaDelegation
at org.activiti.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:81)
at org.activiti.engine.impl.util.ReflectUtil.instantiate(ReflectUtil.java:128)
… 91 more
Caused by: java.lang.ClassNotFoundException: org.acme.runtime.AcmeMoneyJavaDelegation
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.activiti.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:62)
… 92 more

trademak
Star Contributor
Star Contributor
You should export the AcmeMoneyJavaDelegation class to a JAR and place it in the Activiti Explorer WEB-INF lib directory.

Best regards,