How to identify clicked Bpm outcome button ?

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Active Member

How to identify clicked Bpm outcome button ?

Jump to solution

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 Solution

Accepted Solutions
Senior Member

Re: How to identify clicked Bpm outcome button ?

Jump to solution

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 solution in original post

1 Reply
Senior Member

Re: How to identify clicked Bpm outcome button ?

Jump to solution

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 solution in original post