Microflow does not receive all data when sending a POST.

I'm sending the following json post action: My Rest Domain Model:   My publish and update microflows: Account contains no more than the Account_ID. The Request object now finally contains attributes, but only top level attributes, not objects.   How does one get the json contents?   [Update] The json content transfers when I specify it's attributes to the request entity, thus one needs to specialize the request entity to accomodate to the source object. I'm still having problems with objects within objects. [Update] That's in the documentation.  
2 answers

You should really read the documentation: "A published microflow should always have a single transient object as argument. Each field in this transient object is considered a parameter (from HTTP perspective)."


You have a single transient object as input parameter (so you should remove your transaction input object). Your parameters will go into the transient object. In your microflow, you either retrieve of create a persistable object. Then, you define the mapping from the transient object to the persistable object and then you can commit your persistable object.



I assume you are trying to configure this through the UI, instead of through the Java action. I have tried this as well, and I have to admit, it's a pretty terrible UI. What I did:

 - Create a persistent entity Account with an attribute Identifier and an attribute Bedrag

 - Create a non-persistent entity Request (with attributes Account and Bedrag)

 - Create a non-persistent entity Response (with a Boolean attribute Success)

 - Create a microflow Publish (input parameter: Account, output parameter: Response)

 - Create a microflow Update (input parameters: Account, Request, output parameter: Response)


Using this, I was able to configure a service through the UI. Source entity: Account, Key attribute: Identifier

Disable listing, disable GET

Configure the microflows Publish and Update as OnPublishMicroflow and OnUpdateMicroflow respectively.


This configuration can be saved. I have no idea what it does though. My recommendation would be to use the StartMicroflowServiceJava action and configure that in your after startup action. At least it is clear what the action does.



Why do you have both the transient entity and the persistent one as parameters?

I think you just need the transient entity as parameter. You can then use a retrieve to get the transaction. Could be that Mendix doesnt know which object it should populate with the data.


I hope this helps,