package com.proc.task; import java.util.ArrayList; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.camunda.bpm.engine.delegate.JavaDelegate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class LogTask implements JavaDelegate { private static final Logger LOG = LoggerFactory.getLogger( LogTask.class ); @Override public void execute( DelegateExecution execution ) throws Exception { if( execution.hasVariable( "reqPojo" ) ) { MyPojo request = (MyPojo) execution.getVariable( "reqPojo" ); LOG.info( "Request {}={}", request.id, request.field ); request.isDone = Boolean.TRUE; } else if( execution.hasVariable( "theList" ) ) { ArrayList theList = (ArrayList) execution.getVariable( "theList" ); theList.stream().forEach(item -> LOG.info( "Request {}={} isDone:{}" , item.id, item.field, item.isDone ) ); } } }