Runtime components : Core components : CHA : Tasks : Context life cycle : Creating context and changing data value
  
Creating context and changing data value
The following scenarios focus on context creating and data value changing. These scenarios happen in scenes like establishing a session when a user logon, and perform the first step of a transaction.
Scenario I (for Persistence Shared CHA or Memory Shared CHA)
Given that you already have a root Context A:
1 Create a remote Context B
2 Chain the newly created Context B to the root Context A
3 Change the value of Context B using the APIs like setValueAt(), setKeyedCollection()
4 Commit the Context B
Scenario II (for Persistence Shared CHA or Memory Shared CHA)
Given that you already have a root Context A:
1 Crate a local Context B
2 Chain the newly created Context B to Context A
3 Change the value of Context B using the APIs like setValueAt(), setKeyedCollection()
4 Get the value of Context B using the APIs like getValueAt(), getKeyedCollection()
5 Unchain the Context B
Scenario III (for Persistence Shared CHA or Memory Shared CHA)
Given that you already have a remote Context A:
1 Create a remote Context B
2 Chain the newly created Context B to the Context A
3 Change the value of Context B using the APIs like setValueAt(), setKeyedCollection()
4 Commit the Context A
Scenario IV
Given that you have a remote Context A:
1 Create a local Context B
2 Chain the Context B to the Context A
3 Change the value of Context B using the APIs like setValueAt(), setKeyedCollection()
4 Get the value of Context B using the APIs like getValueAt(), getKeyedCollection()
5 Unchain the Context B
6 Commit the Context A
Scenario V (for Persistence Shared CHA, Memory Shared CHA, or Local CHA)
Given that you already have a local Context A:
1 Create a local Context B
2 Chain Context B to Context A
3 Change the value of Context B using the APIs like setValueAt(), setKeyedCollection()
4 Get the value of Context B using APIs like getValue(0, getKeyedCollection()
5 Unchain the Context B
Go up to
Context life cycle