AnsweredAssumed Answered

Dynamically modify Activiti Service Task Properties

Question asked by prasanna_bits on Jun 8, 2011
Latest reply on Jun 9, 2011 by frederikheremans1
Hi,

We have been looking into Activiti for our BPM needs. Forgive my confusion in terminologies as I am very new to Activiti.
We have the following requirement
1. Main work flow based on certain conditions will choose a certain sub-workflow to execute dynamically at runtime ( I have an Idea of how to establish this, I am thinking a custom task type for this )
2. Next is the second step and this is where I am stranded. I need to dynamically using API configure properties of Service Task in the sub-workflow.
I thought I can get Activities within the ProcessDefinition and get Fields within that and modify values of attributes. To explain better

I have the following example workflow
start - scm task type (custom) - hudson task type (custom) - end

scm task type has a property of which SCM type and the SCM Server URL
I need to dynamically set this in the *workflow definition* and save it so that all future instances of the workflow will use the new property.
I was thinking about navigating to the required activity and set the property, but I was not able to retrieve the activities from the process definition. The following code always printing 0.


        ProcessDefinition def = repositoryService.createProcessDefinitionQuery().processDefinitionKey("MyProcess11111").list().get(0);
        ProcessDefinitionEntity ent = (ProcessDefinitionEntity) def;
        System.out.println(ent.getActivities().size());

I would highly appreciate some guidance on what is the best way to solve this problem and how do I get hold of the specific activity within a process definition.

Thanks
Prasanna Rajaperumal
Cisco Systems

Outcomes