我想将一个REST API的输出传递给camunda中的另一个REST-API。我的第一个API是返回JSON,它的值是email。我使用HTTP连接器脚本变量从first REST-API获得输出
<camunda:outputParameter name="email"> <camunda:script scriptFormat="JavaScript">var value = S(NUMBER, 'application/json'); print("DATA ::: "+ value); var response = S(connector.getVariable("response"), 'application/json'); print("Response ::: "+ response ); print("Email :::"+ response.prop("email")); response.prop("email");</camunda:script> </camunda:outputParameter>
现在,我想在另一个使用HTTP-CONNECTOR的rest-API调用的有效负载中传递电子邮件
<camunda:connector> <camunda:inputOutput> <camunda:inputParameter name="url">http://localhost:8080/step2</camunda:inputParameter> <camunda:inputParameter name="method">POST</camunda:inputParameter> <camunda:inputParameter name="header"> <camunda:map> <camunda:entry key="accept">application/json</camunda:entry> <camunda:entry key="content-type">application/json</camunda:entry> </camunda:map> </camunda:inputParameter> <camunda:inputParameter name="payload"> <camunda:script scriptFormat="JavaScript">var email=execution.getVariable("email");</camunda:script>