cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Process instance of a running process

parul_vipparthi
Champ on-the-rise
Champ on-the-rise
Hello

I am doing activiti demo of a small process using jsp and tomcat.
Here is my bpmn


        <process id="usecase_indexer_createwidget" name="Indexer Usecase">
        <startEvent id="StartNoneEvent_2" activiti:formKey="org/idika/galaxy/usecase1/forms/search_document.jsp"/>
        <userTask name="Search Document on First Name, Last Name, SSN" id="searchdoc_on_fn_ln">
        <extensionElements>
          <activiti:taskListener event="create" class="org.idika.galaxy.bpmn.resources.TaskCreateListener_searchdoc_on_fn_ln" />
          <activiti:taskListener event="complete" class="org.idika.galaxy.bpmn.resources.TaskCompleteListener_searchdoc_on_fn_ln">
          </activiti:taskListener>
        </extensionElements>
       </userTask>
        <serviceTask name="Push to Allocate" id="push_to_allocate" activiti:class="org.idika.galaxy.bpmn.resources.servicetask.PushToAllocate_ServiceTaskImpl" />
        <serviceTask name="Append Document to Existing Widget" id="append_doc_to_existing_widget" activiti:class="org.idika.galaxy.bpmn.resources.servicetask.AppendtoWidget_ServiceTaskImpl" />
        <serviceTask name="Create Widget with FN, LN, SSN, and Networth as IndexFields" id="create_widget" activiti:class="org.idika.galaxy.bpmn.resources.servicetask.CreateWidget_ServiceTaskImpl"/>
        <userTask name="Mark Type of Documents" id="mark_doc_types" activiti:formKey="org/idika/galaxy/usecase1/forms/mark_doc_types.jsp"/>

        <exclusiveGateway gatewayDirection="Diverging" name="Document Exists?" id="is_document_existing"/>

        <sequenceFlow id="SequenceFlow_1" sourceRef="StartNoneEvent_2" targetRef="searchdoc_on_fn_ln" />
        <sequenceFlow id="SequenceFlow_2" sourceRef="searchdoc_on_fn_ln" targetRef="is_document_existing" />
        <sequenceFlow id="SequenceFlow_3" sourceRef="is_document_existing" targetRef="append_doc_to_existing_widget"  >
            <conditionExpression xsi:type="tFormalExpression" >${doc_found}</conditionExpression>
        </sequenceFlow>
        <sequenceFlow  id="SequenceFlow_4" sourceRef="is_document_existing" targetRef="create_widget">
            <conditionExpression xsi:type="tFormalExpression" >${!doc_found}</conditionExpression>
        </sequenceFlow>
        <sequenceFlow id="SequenceFlow_5" sourceRef="append_doc_to_existing_widget" targetRef="mark_doc_types" />
        <sequenceFlow id="SequenceFlow_6" sourceRef="create_widget" targetRef="mark_doc_types" />
        <sequenceFlow id="SequenceFlow_7" sourceRef="mark_doc_types" targetRef="push_to_allocate" />
        <sequenceFlow  id="SequenceFlow_8" sourceRef="push_to_allocate" targetRef="theEnd2" />
        <endEvent id="theEnd2" />
    </process>
</definitions>

The form search_document.jsp submits to search_doc_submit.jsp which starts the Process instance and after completing the first user task "Search Document on First Name, Last Name, SSN", shows the form "mark_doc_types.jsp". This form is submitted to mark_doc_type_submit.jsp.  How do I get the process instance id of this process in  mark_doc_type_submit.jsp.

Please help

parul
1 REPLY 1

jbarrez
Star Contributor
Star Contributor
You will have to add it as a hidden field, and process the form on submission.