DavidSowers Posted October 30, 2014 Share Posted October 30, 2014 Alright - I am going to try to phrase a previous question differently and see if anyone can help because I am still having difficulty with this... In the attached, simplified version of what I am attempting, I have a Parent Entity created. And for every Parent Entity, Math.Round((Random.Uniform(1,4)) number of Member Entities are created. Please help me if possible, to set an expression for the Batch Size that waits for each of the created members and batches them. I have the logic for how they match, but I can't seem to get the Batch Quantity to change based on how many of the Members were created each time. Any help appreciated! BatchingLogic.spfx Link to comment Share on other sites More sharing options...
dsturrock Posted October 30, 2014 Share Posted October 30, 2014 I looked at this example and your other posting, so I have a general idea of what you are trying to do. I hestiate to spend too much time on a specific solution because I know that both of these were just examples of your real problem. The key is that the BatchQuantity is determined by (or in the context of) the parent entity. The easiest way to approach this problem is to set a state on the parent entity for its batch size. Here is one way to do that... have the Source object that creates the parents record that value and then create the members. BatchingLogic.spfx Link to comment Share on other sites More sharing options...
DavidSowers Posted November 3, 2014 Author Share Posted November 3, 2014 This is a big help! Thank you! The one thing that I still can't figure out, is that when I create a state, for instance "BatchQuantity" like you did... I can't attach it to an Entity as you did in the drop down menu for the state Variable name. For example: State Variable Name Dropdown reads: "BatchQuantity" Instead of "ModelEntity.BatchQuantity" Am I doing something wrong? David Link to comment Share on other sites More sharing options...
dsturrock Posted November 3, 2014 Share Posted November 3, 2014 In the navigation window, click on ModelEntity (or any other object that you want to modify) and you can add states to that object definition. Otherwise you are adding the states to the model itself. Link to comment Share on other sites More sharing options...
DavidSowers Posted November 4, 2014 Author Share Posted November 4, 2014 Thanks! I actually realized this just before reading your post thank you though! Link to comment Share on other sites More sharing options...
Recommended Posts