mirror of
https://github.com/corda/corda.git
synced 2025-06-19 15:43:52 +00:00
Fixed the CorDapp configuration demo (#2967)
This commit is contained in:
@ -1,10 +0,0 @@
|
||||
package net.corda.configsample
|
||||
|
||||
import net.corda.core.flows.FlowLogic
|
||||
|
||||
class ConfigSampleFlow : FlowLogic<String>() {
|
||||
override fun call(): String {
|
||||
val config = serviceHub.getAppContext().config
|
||||
return config.getString("someStringValue")
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package net.corda.configsample
|
||||
|
||||
import co.paralleluniverse.fibers.Suspendable
|
||||
import net.corda.core.flows.FlowLogic
|
||||
import net.corda.core.flows.StartableByRPC
|
||||
import net.corda.core.utilities.ProgressTracker
|
||||
|
||||
@StartableByRPC
|
||||
class GetStringConfigFlow(private val configKey: String) : FlowLogic<String>() {
|
||||
object READING : ProgressTracker.Step("Reading config")
|
||||
override val progressTracker = ProgressTracker(READING)
|
||||
|
||||
@Suspendable
|
||||
override fun call(): String {
|
||||
progressTracker.currentStep = READING
|
||||
val config = serviceHub.getAppContext().config
|
||||
return config.getString(configKey)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user