cancel
Showing results for 
Search instead for 
Did you mean: 

Custom process model metadata and categories?

jonvargas
Confirmed Champ
Confirmed Champ
Hi there,

We do require to define a "code number" for every process model, so it could be used later to attach documents by using a custom name sequence. What choices do I have to accomplish this on Activiti?

* Do we have to define this metadata in BPMN model? Or where?
* Is metadata managed through Model.getMetaInfo () and Model.setMetaInfo () functions?
* If so, is there a specific format that should be used or is it freestyle?
* Could a process model metadata be set at runtime and stored in activiti database?

Thanks in advance.
4 REPLIES 4

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Jonathan,

you can use similar way as activiti uses:
http://www.activiti.org/userguide/#bpmnCustomExtensions
e.g.


<process id="testEventListeners">
  <extensionElements>
    <activiti:eventListener class="org.activiti.engine.test.MyEventListener" />
    <activiti:eventListener delegateExpression="${testEventListener}" events="JOB_EXECUTION_SUCCESS,JOB_EXECUTION_FAILURE" />
  </extensionElements>

Regards
Martin

chandanmb1
Champ on-the-rise
Champ on-the-rise
Hello Martin,

I have a requirement to store URL and username as a part of each task in the BPMN process and use it later during activiti execution.
Can we do something like below and how to get metadata later from activiti ? Is there any API which has been exposed?
I saw something like
<code>
repositoryService.getBpmnModel("").getDataStores()
</code>

<code>
<process id="xyz" name="PRO" isExecutable="true">
    <documentation>Workflow</documentation>
    <startEvent id="start" name="Start " activiti:initiator="initiator"></startEvent>
    <sequenceFlow id="sequenceFlow1" sourceRef="start" targetRef="User"></sequenceFlow>
    <userTask id="User" name="User" activiti:assignee="${approver}">
      <extensionElements>
        <activiti:metadata id="URL" name="URL" type="string">localhost</activiti:metadata>
      </extensionElements>
    </userTask>
</code>

Please help!!

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Jonathan,

I do not know whether I have understood your issue correctly.
I would store information as a process variable at the beginning of the process instance.

Regards
Martin

chandanmb1
Champ on-the-rise
Champ on-the-rise
No.
Question is during designing of the workflow modelling.
I will click on a UserTask(JiraService) and provide the inputs(additional attributes like URL and username).
Once designing of workflow is complete and click on Save, BPMN XML is generated. In that XML can we embed these additional attributes?
If we can, then after starting the process do we have an API to get these additional attributes by some means?