Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set different workflows to the same task queue #19

Open
pvolchak opened this issue Aug 25, 2021 · 2 comments
Open

Unable to set different workflows to the same task queue #19

pvolchak opened this issue Aug 25, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@pvolchak
Copy link
Contributor

pvolchak commented Aug 25, 2021

When assigning 2 different activities to the same task queue and try running one of the workflows as a child workflow or just run one of them separately i get the following error: Unknown workflow type "TestNumberDefinition". Known types are [TestNumberReversedDefinition]. my application yaml looks like such for the workflows
workflows: testNumberReversed: taskQueue: testNumber testNumber: taskQueue: testNumber testString: taskQueue: testString activityStubDefaults: scheduleToCloseTimeout: PT30S

my test number and test number reversed look like such

`@Component
@TemporalWorkflow("testNumberReversed")
open class TestNumberReversed: TestNumberReversedDefinition {

override fun someNumberReverse(): Int {
    val options: ChildWorkflowOptions = ChildWorkflowOptions
        .newBuilder()
        .setTaskQueue("testNumber")
        .setParentClosePolicy(ParentClosePolicy.PARENT_CLOSE_POLICY_ABANDON)
        .build()

    val child = Workflow.newChildWorkflowStub(TestNumberDefinition::class.java, options)
    val childExecution = Async.function(child::someNumber)
    var num = (childExecution.get().toDouble() * 100).toInt()
    var reversed = 0

    while (num != 0) {
        val digit = num % 10
        reversed = reversed * 10 + digit
        num /= 10
    }

    return reversed
}

}

@WorkflowInterface
interface TestNumberReversedDefinition {
@WorkflowMethod fun someNumberReverse(): Int
}`

`@Component
@TemporalWorkflow("testNumber")
open class TestNumber: TestNumberDefinition {

@ActivityStub lateinit var numberActivity: NumberActivityDefinition

override fun someNumber(): Double {
    return numberActivity.getSomeNumber()
}

}

@WorkflowInterface
interface TestNumberDefinition {
@WorkflowMethod fun someNumber(): Double
}`

@simcha
Copy link
Collaborator

simcha commented Aug 26, 2021

Ok and when you put different cues it works?

@pvolchak
Copy link
Contributor Author

yes. sir. it looks like my task queue and a workflow have a 1 to 1 relationship. i just followed the example for the workflow definitions saying workflows: one: one, two: one

@simcha simcha self-assigned this Apr 2, 2022
@simcha simcha added the bug Something isn't working label Apr 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants