0

I am working on a requirement which needs a design to update a predicate@master from one of the workbooks.So, I have added below logic in an inactive block which is invoked for an user action.

+predicate2@master[x,y] = flag <- predicate1@prev[x,y] = flag,flag = true.

Please note that I need to delete facts from predicate1 once it is copied to predicate2 in the master copy.

when this logic is compiled, I get below error.

block block_4SZVZ9DO: line 24: error: stage 'master' of 'predicate2@master' is earlier than run-stage 'INITIAL'; deriving facts for past stages is not allowed (code: STAGE_PAST) +predicate2@master[x,y] = flag

Please help with a way to update predicates in Master from workbooks.

Thanks, Senthilvel

1 Answers1

1

The issue is that the logic updating a predicate@branch, must be executed on that branch. For your logic, you would need to execute it on the master. It seems that you're executing the logic on a workbook, rather than the master, right?

I think a bigger question though, is whether you need to write this logic. The mechanism we have for updating master from workbook is through "commit" service call, provided by the workbook framework. Have you tried using it? Or does it not satisfy your need somehow?

  • Yes, this logic is in the workbook. I have not tried using "commit" service call as our requirement was little different. We need to update this specific predicate only when the user performs a "Export" action. Requirement: Ability for user to export few measures out of workbook to other outbound systems. Design: 1. Create a protobuf service to export the measures to json – Senthilvel Jun 10 '16 at 21:15
  • Yes, this logic is in the workbook. I have not tried using "commit" service call as our requirement was little different. We need to update this specific predicate only when the user performs a "Export" action and we dont have to update any other predicates during this action. Scenario:- User is in workbook and decides to export data to downstream system by selecting few rows. Upon export action, we are trying to copy the "selection" to master. Once it is available in master, we will run a script to extract the predicate from master and issue web-client call to get the json output. – Senthilvel Jun 10 '16 at 21:26
  • Shan - Thanks for your response. – Senthilvel Jun 10 '16 at 21:26