0

I am currently working on a cameo model, trying to make it executable. For this we need a data exchange from action to action and interaction with that data.

You can imagine it like this: The user inputs values "Mission 1" 100 "Task 1" Depending on those values, there should be decisions made in the execution and those values should be changed. I imagined doing it using decisions and opaque actions. Unfortunately it turns out that it's harder than expected.

Here's my approaches:

  1. I created a datatype that includes a String (this property is called P1) and an Integer (this property is called P2) and then created an instance of it: Datatype and Instance Then I tried to access one of those two values by setting up an opaque action with an input called "input" and the body as "x = input.P1". "x" is the name of the output of the opaque action. Like this, I just wanted to seperate P1 from the data: Diagram with instance and opaque action This didn't work, as an Undefined object is the result i end up with.

  2. I thought, well, using a datatype might be better but i can find a workaround and tried to define an array as the output of an opaque action and access it in another opaque action. I figured out that if i do it like "result = ["Test",1]" The opaque action will just send "Test" and in the next iteration send 1, but not at the same time as an array as i wished. Then I thought, well, not too bad, let's just make a decision that checks if the value is a String, like this we can seperate the data as well, but turns out the "Test" will not be sent as a string and my setup doesnt work either: This approach

  3. Then i tried something else, here an NativeArray Object is sent, but then when i try to access it via "x = input[0]" the result is "o", as this is the first letter of the name of the object starting with "org.javascript....": Third approach

I could not find any way to get what I want and therefore hope that someone can help me with my issue as I can not imagine that what I want is not possible at all. I use Cameo Systems Modeler 2021x and UAF Architecture. Thanks in Advance.

2
  • Please provide enough code so others can better understand or reproduce the problem. Commented Feb 28, 2024 at 10:45
  • @OyinladeDemola, there is no more code to provide as it is a Model, not a script. All information provided is in the images linked. Commented Feb 28, 2024 at 16:17

1 Answer 1

0

Firstly, use Block instead of DataType, name the block as "TestDataType" and create two properties P1: String and P2:Integer. Like this

Define the block

Then make your input typed as "TestDataType" and you can access to input.P1 and input.P2. Like this

access to P1 and P2

Hope it helps!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.