5.3. IM-BIS¶
IM-BPMから、IM-BISとの連携方法を説明します。
IM-BPMから、IM-BISと連携する場合、jugglingプロジェクトにてアプリケーションを追加する必要があります。
5.3.1. 起票・申請タスクに前処理ユーザプログラムを設定する¶
IM-BISを起票、または、申請する前の処理を差し込みます。
前処理ユーザプログラムは、決められたインタフェースを実装する必要があります。
package sample; import jp.co.intra_mart.activiti.engine.delegate.DelegateExecution; import jp.co.intra_mart.activiti.engine.delegate.ImBisDraftPreprocess; import jp.co.intra_mart.foundation.workflow.application.model.param.DraftParam; public class SampleBisDraftPreprocess implements ImBisDraftPreprocess { @Override public void execute(DelegateExecution execution, DraftParam param) throws Exception { String matterName = (String) execution.getVariable("matterName"); String matterNumber = (String) execution.getVariable("matterNumber"); if (matterName != null) { param.setMatterName(matterName); } if (matterNumber != null) { param.setMatterNumber(matterNumber); } } }package sample; import java.util.Map; import jp.co.intra_mart.activiti.engine.delegate.DelegateExecution; import jp.co.intra_mart.activiti.engine.delegate.ImBisApplyParamModel; import jp.co.intra_mart.activiti.engine.delegate.ImBisApplyPreprocess; import jp.co.intra_mart.foundation.workflow.application.model.param.ApplyParam; import jp.co.intra_mart.foundation.forma.imw.api.type.impl.StandardFormaUserParamKey; public class SampleBisApplyPreprocess implements ImBisApplyPreprocess { @Override public void execute(DelegateExecution execution, ImBisApplyParamModel model) throws Exception { ApplyParam applyParam = model.getApplyParam(); String matterName = (String) execution.getVariable("matterName"); String matterNumber = (String) execution.getVariable("matterNumber"); if (matterName != null) { applyParam.setMatterName(matterName); } if (matterNumber != null) { applyParam.setMatterNumber(matterNumber); } Map<String, Object> itemsMap = model.getFormaUserParam.get(StandardFormaUserParamKey.ITEMS); String param1 = (String) execution.getVariable("param1"); String param2 = (String) execution.getVariable("param2"); itemsMap.put("param1", param1); itemsMap.put("param2", param2); } }