0

我有一个正在运行的工作流程,我想通过 API 调用将字段发布到(见下文):

 $ret = invokeFlowgear(
   "https://domain.flowgear.io/salesbooks",
   "username",
   "password",
  30,
  array(
     'name' => 'Introduction to Data integration with Flowgear',
     'isbn' => 'X-XXX-XXXX',
     'qis' => 0,
     'price' => 250.99,
     'author_id' => 3  
   )
);

最终,此调用应导致工作流将数据插入表并返回成功消息。

我需要什么才能通过 API 使用工作流来实现这一目标?

4

1 回答 1

1

You need to accept the raw HTTP POST body into the Workflow. To do that, set an appropriate URL ("/salesbooks/") in the workflow detail pane and set the method to POST.

Then drop in a Variable Bar and add the special property FgRequestBody. Optionally also add FgRequestContentType so you can inspect the content type of the message being received.

Create an HTTP POST to that Workflow and you can see what's coming through to the FgRequestBody property (it will show in the Start entry in the activity logs).

If you need to convert between JSON and XML, using JSON Convert.

于 2014-09-24T07:00:44.757 回答