cancel
Showing results for 
Search instead for 
Did you mean: 

How to identify clicked Bpm outcome button ?

dharmraj
Confirmed Champ
Confirmed Champ

When i clicked any outcome button its complete the task . i have more than one button .Can i call different event on button click?

1 ACCEPTED ANSWER

kalpesh_c2
Star Collaborator
Star Collaborator

Hi, Dharmraj Gurjar

you can execute your script based on the outcome button click
refer this example

<userTask id="reviewTask" name="Review Task" activiti:assignee="${bpm_assignee.properties.userName}" activiti:formKey="wf:activitiReviewTask">
      <extensionElements>
         <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string><![CDATA[
//getting your task outcome , you can get the outcome button value by using this
// wf_reviewOutcome your modelPrefix_outcomeProperty
task.getVariable('wf_reviewOutcome');
                ]]>
</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>

Thanks,
Kalpesh,
ContCentric

View answer in original post

1 REPLY 1

kalpesh_c2
Star Collaborator
Star Collaborator

Hi, Dharmraj Gurjar

you can execute your script based on the outcome button click
refer this example

<userTask id="reviewTask" name="Review Task" activiti:assignee="${bpm_assignee.properties.userName}" activiti:formKey="wf:activitiReviewTask">
      <extensionElements>
         <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string><![CDATA[
//getting your task outcome , you can get the outcome button value by using this
// wf_reviewOutcome your modelPrefix_outcomeProperty
task.getVariable('wf_reviewOutcome');
                ]]>
</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>

Thanks,
Kalpesh,
ContCentric