cancel
Showing results for 
Search instead for 
Did you mean: 

ProcessInstanceID

psernetz
Champ in-the-making
Champ in-the-making
Hi,

I am playing around with the mule <-> activiti integration. To start a process from mule I use the

   <activiti:outbound-endpoint description="RequestCampaignCodesProcess">
      <activiti:create-process />
   </activiti:outbound-endpoint>

function and define the process with a script:component

   <script:component>
      <script:script engine="groovy">
         Map map = new HashMap()
         map.put("processDefinitionId", "RequestCampaignCodes:1:249") //the id of the definition
         //map.put("processDefinitionKey", "RequestCampaignCodes:1") //the id of the definition
         
         return map
      </script:script>
   </script:component>

But what is the best way to get the id. I know the name of the process (RequestCampaignCodes) and I know the revision (1), but what about the random number (249)?

http://www.activiti.org/userguide/index.html#versioningOfProcessDefinitions
http://www.activiti.org/userguide/index.html#versioningOfProcessDefinitions
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
The random nrs are to make sure the process definition caches are in sync when running Activiti on a cluster.

This cache could get out of sync in case of process definition deletion + redeploy on one machine, while the other machine still has the old definition in cache.

psernetz
Champ in-the-making
Champ in-the-making
Hi,

Thank you for your reply. I understand why you need this random id, but how can I retrieve this ID? I want to start a process with the activiti-rest api. The only way I found so far is, select the process table in the database and lookup the process id + rnd_id.

It would be a nice thing if I could see this rnd_id in the deployment or process view of the activiti-probe.



Regards,
Patrick

nickparker
Champ in-the-making
Champ in-the-making
If we want to start an Activiti process from a Mule flow then placing the version number of the process and the random id into the flow creates a tightly coupled application, which is what all architects are trying to avoid these days. Ideally the Mule flow would know the process name but only want to invoke the latest version.

Is there a parameter we can set such as processInstanceName instead of ProcessInstanceId which will start the latest version of a process.

I am very new to Activiti and Mule and we are completing a POC which is designed to identify the advantages of process modelling and a lightweight ESB.  The first thing which is apparent is that debugging of Groovy script in both the Mule flow and within Activiti is painfull.  I love Activiti as a whole and can see many opportunities for it in our solution however at present the timeline cost of developing an Activiti based solution to say an EJB build means we are not convinced that Activiti is the final answer at present.  A visual debugger would be great that could allow you to step through each task would be great, the you could at least see which part of the process went bang!  Maybe it is possible to tell this from them stack trace but I cant work it out myself.  The kind of problems I tend to have are daft Groovy syntax errors.