| 148 | |
| 149 | |
| 150 | bool WorkflowMachine::PostJsonRequest(const std::string& request) |
| 151 | { |
| 152 | string jsonResult; |
| 153 | if (m_function) |
| 154 | jsonResult = BNPostWorkflowRequestForFunction(m_function->GetObject(), request.c_str()); |
| 155 | else |
| 156 | jsonResult = BNPostWorkflowRequestForBinaryView(m_view->GetObject(), request.c_str()); |
| 157 | |
| 158 | rapidjson::Document response(rapidjson::kObjectType); |
| 159 | response.Parse(jsonResult.c_str()); |
| 160 | if (response.HasMember("commandStatus") && response["commandStatus"].HasMember("accepted")) |
| 161 | return response["commandStatus"]["accepted"].GetBool(); |
| 162 | |
| 163 | return false; |
| 164 | } |
| 165 | |
| 166 | |
| 167 | bool WorkflowMachine::Run() |