EzDevInfo.com

Activiti

Activiti is a light-weight workflow and Business Process Management (BPM) Platform targeted at business people, developers and system admins. Its core is a super-fast and rock-solid BPMN 2 process engine for Java. It's open-source and distributed under the Apache license. Activiti runs in any Java application, on a server, on a cluster or in the… Activiti

Add new workflow into Alfresco share

I'm new to Alfresco/Activiti.

Our company is using Skelta BPM.NET (in integration with our self developed RMS) and now we would like to take a look into other BPM software.

I last days I found our how to create new workflow using Eclipse and Import them into standalone installation of Activiti.

Now I would like to publish this workflow into Alfresco share. Is there any easy way to do that? I was searching whole day on Google but didn't find anything useful.

And another question about installation: Is it possible to install Activiti with all it's webapps on the same tomcat, that alfresco is running on? That Apache Ant can build only standalone installation. So can this two application be merged?

Thanks for your info, Anze


Source: (StackOverflow)

Process Engines for BPMN 2.0

I'm doing a comparison among all existing BPMN 2.0 Process Engines e.g. Activiti, jBPM etc. I've prepared a list of 4 process engines which executes BPMN 2.0 given below;

Popular BPMN 2.0 compliant open-source engines:

Activiti: http://www.activiti.org/
jBPM: http://www.jboss.org/jbpm
Bonita: http://www.bonitasoft.com/

A commercial engine:

ActiveVOS: http://www.activevos.com/products

I would appreciate your help if you enhance my research by adding any existing Process Engines (for BPMN 2.0) in the above list along with the quick comparison among all.

I would prefer a very short comparison listing only important features (distinguishing features like what is possible for one and not for others, licensing, dependencies with other products like tomcat & JBoss and operating systems etc)

P.S: I've found much on Activiti vs jBPM but still your answers will be a favor.


Source: (StackOverflow)

Advertisements

Using both JPA EntityManager and Hibernate session with shared transaction manager in Spring

We have a hard situation.

  1. There is a large project which uses hibernate special features so cannot quit hibernate.
  2. We are to add Activiti process engine to the project in embedded mode and make use of JPA extensions (which only works with EntityManager)
  3. Some entities should not be present in JPA persistent unit because as activiti documentation says all entities must have @Id and cannot use @IdClass/@EmbeddedId so we have to exclude such entities from persistent unit
  4. We wish to use one shared transaction manager for EntityManager and Session. Also the dataSources are identical (or even shared)
  5. Everything is Spring!

All this effort is to enable Activiti to use EntityManager for its JPA extension while letting existing hibernate dependent codes to continue work.


Source: (StackOverflow)

Complex Activiti + JPA queries

We are trying to use Activiti in a new project. I've created a setup which uses Hibernate through JPA for persisting entities involved in the process and JPA is interconnected with Activiti so we can use these entities as JPA variables. See: JPA chapter of Activiti's documentation

I've found out that Activiti doesn't allow me to create queries on processes which involves JPA variables where i like to filter on the JPA entity fields. For example if i have processes with a variable referencing Book entities i can't create a query for processes which have a book with a specific title.

What's the best method to overcome this? I though about querying the entities seperately with Hibernate then do a second query on Activiti to get the processes involved however i'm affraid it will be slow. Also if i'm doing it the other way around (querying the processes first then do a second query with Hibernate on the entities) Activiti does an unnecessarry fill of the JPA variables and i couldn't find out how to get only the entity ID which saved into the Activiti variables table of my database.


Source: (StackOverflow)

build workflow engine with Akka

In our Scala/Play application we use activiti. (also experimenting with camunda) users can create workflows (shown in this picture http://camunda.com/ ). All calls to these external workflow engines are wrapped in Scala Future (activiti and camunda APIs are all Java blocking APIs).

is there any library to implement workflows totally using Akka/Actors avoiding heavy toolkits like activiti/camunda? Or ideas how to best use Akka with activiti/camunda ?


Source: (StackOverflow)

Using a workflow engine, state machine engine or rolling my own?

I'm confused. I'm developing a grails based internal tool for my company. One component in this tool is a simple issue tracker (a Helpdesk feature). I have domain objects such as Problem, Question and NewFeature. Each of these domain classes have different workflows.

My initial idea was to roll my own state machine functionality inside the domain objects. I then googled for state machine engines and workflow engines. And now I'm lost.

I would like to have comments how other developers have solved this problem. Do you use Drools, Jbpm, Activiti? Or some simpler state machine engine?

I have been reading some documentation for the Drools, Jbpm. They look very nice. But it seems like I only need a small part of the features these libraries provide.

I'm using Grails for this but it's of course easy to use Java libraries as well.


Source: (StackOverflow)

Activiti BPM get Variables within Task

is it possible to get all process or task variables using TaskService:

processEngine.getTaskService.createTaskQuery().list();

I know there is an opportunity to get variables via processEngine.getTaskService().getVariable()

or

processEngine.getRuntimeService().getVariable()

but every of operation above goes to database. If I have list of 100 tasks I'll make 100 queries to DB. I don't want to use this approach. Is there any other way to get task or process related variables?


Source: (StackOverflow)

How to get enum values in activiti and what is return type of getType() of FormProperty in activiti?

I want to get the values of the enum property.

In activiti 5.13 userguide,

the enumeration values are accessible with formProperty.getType().getInformation("values")

In activiti docs,return type of getType() is FormType. But in my code getType() return type is String. So i couldn't call FormType's getInformation() method.

When i am using formProperty.getType().getInformation("values"), i got the following error.

Cannot cast object 'enum' with class 'java.lang.String' to class 'org.activiti.engine.form.FormType'.

How could i get the values of enum?


Source: (StackOverflow)

Lightweight workflow engine for Java

Is it better to write a new workflow engine use an existing BPM engine: jBPM 5, Activiti 5?

My application is a web based application and performance is important. My doubt is whether using jBPM/Activiti will be a performance overhead compared to writing a simple workflow engine.

If I go with self implementation, I will miss visualization of workflow. For performance it can be traded.


Source: (StackOverflow)

JBoss and Resteasy: ClassNotFoundException while deserializing java-serialized object

Context: we are using Activiti as a process engine and Activiti-Rest as its interface towards our application. As the question is related to REST services returning objects serialized by Java, I did not add this to the title.

Scenario: we have a JBoss Wildfly instance which contains an EAR with a module (lets call it X for reference) that contains a class "ProcessContext". Activiti is running inside this EAR and the ServiceTasks (Java-snippets getting called from the processes to do some work) depend on that class. They use this class to instantiate a process variable and add some data to it.

We have a second deployment (a WAR, currently on the same Wildfly instance but later on a remote server), which accesses Activiti by its REST api and now we need to access the "ProcessContext" data. This WAR also has a dependency on X and its classloader can resolve "ProcessContext" without problems.

Ok, fine. Doing so seemed simple. Call:

GET history/historic-process-instances/{processInstanceId}/variables/{variableName}/data

This returns a response with MediaType "application/x-java-serialized-object" and inspecting it with the debugger seemed fine. But when I tried to deserialize the object I got this error:

Caused by: java.lang.ClassNotFoundException: xxx.commons.metadata.ProcessMetadata from [Module "org.jboss.resteasy.resteasy-jaxrs:main" from local module loader @103f852 (finder: local module finder @587c290d (roots: /opt/wildfly/modules,/opt/wildfly/modules/system/layers/base))]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final]
at java.lang.Class.forName0(Native Method) [rt.jar:1.8.0_20]
at java.lang.Class.forName(Class.java:340) [rt.jar:1.8.0_20]
at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:626) [rt.jar:1.8.0_20]
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1613) [rt.jar:1.8.0_20]
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1518) [rt.jar:1.8.0_20]
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1774) [rt.jar:1.8.0_20]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) [rt.jar:1.8.0_20]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371) [rt.jar:1.8.0_20]
at org.jboss.resteasy.plugins.providers.SerializableProvider.readFrom(SerializableProvider.java:76) [resteasy-jaxrs-3.0.10.Final.jar:]
... 131 more

Wondering about it I found that the Classloader that is used to deserialize the object if the Module-Classloader of the Resteasy module instead my local (module) classloader.

One solution would probably be to write a module that contains "ProcessContext" and make it globally known in JBoss but that is some infrastructure-decission that was denied by the project lead.

Shouldn't Resteasy rather use the classloader of the caller instead its module classloader? The caller knows its required classes and if I could get hands on the responses internal input stream I could deserialize it myself without any problems. I realy wonder if this a bug or a feature.

Any ideas how to solve this problem?


Source: (StackOverflow)

Expired activiti jobs throwing exception while server startup - Grails

This is with regard to activiti workflow timer jobs in grails application.

While starting the grails app with expired jobs, exception is thrown for normal grails features such as log and methods of domain classes.

For eg:

Caused by: groovy.lang.MissingPropertyException: No such property: log for class: com.service.common.UtilityService
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:49)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassGetPropertySite.getProperty(PogoMetaClassGetPropertySite.java:50)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:239)
    at com.service.common.UtilityService.insertToQueue(UtilityService.groovy:370)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.activiti.engine.impl.javax.el.BeanELResolver.invoke(BeanELResolver.java:479)
    ... 71 more

This happens in dev environment running the app from Spring STS. We are using activiti plugin 5.8.2 for grails (1.3.6)

After the web-app is started up completely, the jobs (schedule to a time after startup) run properly and no missing property exception is thrown.

Even though we can fix the of missing property issue for log by using private static final log = LogFactory.getLog(this) instead, then any reference to domain classes throw an error, like using get or find method.

eg:

Caused by: groovy.lang.MissingMethodException: No signature of method: static com.domain.wr.WorkRequest.read() is applicable for argument types: (java.lang.String) values: [44700]
Possible solutions: getId(), getAt(java.lang.String), setId(java.lang.Long), grep(java.lang.Object), each(groovy.lang.Closure), find(groovy.lang.Closure)
    at groovy.lang.MetaClassImpl.invokeStaticMissingMethod(MetaClassImpl.java:1357)
    at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1343)
    at groovy.lang.ExpandoMetaClass.invokeStaticMethod(ExpandoMetaClass.java:1082)
    at org.codehaus.groovy.runtime.callsite.StaticMetaClassSite.call(StaticMetaClassSite.java:50)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
    at com.service.common.UtilityService.insertToQueue(UtilityService.groovy:373)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.activiti.engine.impl.javax.el.BeanELResolver.invoke(BeanELResolver.java:479)
    ... 71 more

Activiti Configuration

Config.groovy

// Added by the Grails Activiti plugin:
activiti {
      processEngineName = "activiti-engine-default"
      databaseType = "oracle"
      deploymentName = appName
      history = "audit" // "none", "activity", "audit" or "full"
      sessionUsernameKey = "username"
      useFormKey = true
      deploymentResources = ["classpath:activiti/escalation/WorkRequest.bpmn20.xml"]

}

Config.properties

activiti.processEngineName =activiti-engine-default
activiti.databaseSchemaUpdate =true 
activiti.jobExecutorActivate =true
activiti.mailServerHost = "mail1.net"
activiti.mailServerPort = 25
activiti.mailServerUsername = ""
activiti.mailServerPassword = ""
activiti.mailServerDefaultFrom = ""

This is killing my application as a downtime makes the workflow unusable with timer tasks.


Source: (StackOverflow)

How to use own user table instead of apache activiti workflow?

I want to integrate Activiti workflow with my Java application but I want to use my own user table instead of activiti act_id_user table and want to make relation of my user table with activiti database, is this possible? If yes then please provide me a demo application of workflow with java for reference.


Source: (StackOverflow)

getDefaultProcessEngine() return null [closed]

ProcessEngines.getDefaultProcessEngine() return me null when I try init a new process in activiti engine.

Do you know what could be the reason ?


Source: (StackOverflow)

Issue tracker via Activiti

Here is a problem to implement task tracker, which supports

  1. tasks with statuses such as opened, in progress, hanging, resolved
  2. simple workflows (i.e. signing document by multiple people http://i.gyazo.com/8247c0981cdf003a29a4783272eb4211.png)

According to the second requirement I am about to use Activiti in the development.

However, I have no idea how to add support of task statuses in Activiti. Built-in User Task can only be closed.

Workarounds:

  1. To encapsulate statuses in code. But I think it smells.

Any ideas?


Source: (StackOverflow)

activiti multi-instance for each loop with empty collection

In our workflows we have several multi-instance call activities, like the following:

<callActivity id="loopFoos" calledElement="${workflowResolver.resolveWorkflowName(foo)}">
    <multiInstanceLoopCharacteristics isSequential="false" activiti:collection="${foos}" activiti:elementVariable="foo" />
</callActivity>

The problem is that some of the collections are empty and that leads to exceptions because activiti assumes that there is at least one element in the collection. We could make decisions around all the subworkflow calls but that would pollute the the workflow diagram with non-business-relevant details.

What we would need is the behaviour of java for each like

for (Foo foo : foos) {
 // call workflow
}

where empty collections simply don't enter the loop.

Is there a way to make activiti behave like this? How would you model the workflow if there isn't?


Source: (StackOverflow)