getFromDB( $datas['id'] ) && $asyncdata->fields['state'] == PluginProcessmakerCrontaskaction::WAITING_DATAS ) { $initialdatas = json_decode($asyncdata->fields['postdatas'], true); $initialdatas['form'] = array_merge( $initialdatas['form'], $datas['form'] ) ; $asyncdata->update( array( 'id' => $datas['id'], 'state' => PluginProcessmakerCrontaskaction::DATAS_READY, 'postdatas' => json_encode($initialdatas, JSON_HEX_APOS | JSON_HEX_QUOT) ) ) ; $ret = array( 'code' => '0', 'message' => 'Done' ); } else { $ret = array( 'code' => '2', 'message' => 'Case is not existing, or state is not WAITING_DATAS' ); } break; default: $ret = array( 'code' => '1', 'message' => 'Method not supported' ) ; } echo json_encode( $ret, JSON_HEX_APOS | JSON_HEX_QUOT ) ; }