AnsweredAssumed Answered

How do we set parameters value while querying Activiti database

Question asked by rajiv_cusat on Sep 1, 2015
Latest reply on Sep 14, 2015 by rajiv_cusat
Hi Guys,
                I am new to Activiti Framework, need to know how do we set parameters value while querying Activiti database…..

Below are the select query which I am calling from my java program……

<mapper resource="org/activiti/db/mapping/entity/HistoricActivityInstance.xml" />

<!– HISTORIC ACTIVITY INSTANCE SELECT –>
 
  <select id="selectHistoricActivityInstance" resultMap="historicActivityInstanceResultMap">
    select * from ${prefix}ACT_HI_ACTINST where ACT_ID_ = #{activityId} and PROC_INST_ID_ = #{processInstanceId}
  </select>

<!—–Java Program to call the above select query —–>

List<HistoricActivityInstanceEntity> historicActivityInstanceList = getManagementServiceInstance().executeCommand(new Command<List<HistoricActivityInstanceEntity>>() {
            
               @SuppressWarnings("unchecked")
               public List<HistoricActivityInstanceEntity> execute(CommandContext commandContext) {
                 return (List<HistoricActivityInstanceEntity>) commandContext.getDbSqlSession().selectList("selectHistoricActivityInstance");
               }
             });

Now question is how do we pass value for #{activityId} and #{processInstanceId} from java program ??

please advise as soon as possible.
please do let me know if any clarification required.

Thanks,
Rajiv.

Outcomes